Re: indent ifconfig(8) bridge rules output

2015-07-17 Thread Reyk Floeter
On Sat, Jul 18, 2015 at 01:54:39AM -0300, Rafael Zalamena wrote: > This diff indents the output of bridge rules in ifconfig or ifconfig bridgeX. > OK reyk@ > Old output: > $ ifconfig bridge0 > bridge0: flags=41 > groups: bridge > priority 32768 hellotime 2

indent ifconfig(8) bridge rules output

2015-07-17 Thread Rafael Zalamena
This diff indents the output of bridge rules in ifconfig or ifconfig bridgeX. Old output: $ ifconfig bridge0 bridge0: flags=41 groups: bridge priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp designated: id 00:00:00:00:00:00 priority 0 tun1

Re: Bridge rules

2012-07-01 Thread Theo de Raadt
> * sven falempin [2012-06-30 15:49]: > > I do not understand the other complain. > > especilly when it s userland code (the string stuff was done inside > > ifconfig) > > using string matching for this is the wrong approach to begin with. > mac addresses are just numbers, after all. so a msked c

Re: Bridge rules

2012-06-30 Thread sven falempin
beyond the missing & in bzero in brconfig.c i certainly broke something << bridge0: flags=0<> groups: bridge priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp vether0 flags=3 port 6 ifpriority 0 ifcost 0 re0 flags=3

Re: Bridge rules

2012-06-30 Thread sven falempin
should be more likely an expected diff 2012/6/30 Stuart Henderson > On 2012/06/30 09:47, sven falempin wrote: > > Stuart, > > > > The flag is there to not change old behavior. > > Since masking with all 0's is pointless, you can use that to identify the > standard behaviour, checking against 0 i

Re: Bridge rules

2012-06-30 Thread Stuart Henderson
On 2012/06/30 09:47, sven falempin wrote: > Stuart, > > The flag is there to not change old behavior. Since masking with all 0's is pointless, you can use that to identify the standard behaviour, checking against 0 is a fast way to determine if the mask should be applied at all (this means a mask

Re: Bridge rules

2012-06-30 Thread Henning Brauer
* sven falempin [2012-06-30 15:49]: > I do not understand the other complain. > especilly when it s userland code (the string stuff was done inside > ifconfig) using string matching for this is the wrong approach to begin with. mac addresses are just numbers, after all. so a msked compare it is.

Re: Bridge rules

2012-06-30 Thread sven falempin
Stuart, The flag is there to not change old behavior. Of course matching the beggining of mac make sense the rest is just strange behavior. But a mac address could be spoof, so it may be used. Its just a - and an if else. thx. I do not understand the other complain. especilly when it s userland

Re: Bridge rules

2012-06-30 Thread Stuart Henderson
On 2012/06/29 20:05, sven falempin wrote: > ifconfig bridge0 rule pass in on fxp0 src de:ff:* wouldn't it be simpler to just allow a mask value to be set, then you don't need to mess with extra flag variables, just mask the MAC address with this value before comparison. > ifconfig bridge0 rule pa

Re: Bridge rules

2012-06-30 Thread Henning Brauer
* sven falempin [2012-06-30 02:06]: > - ea = ether_aton(argv[0]); > + m_size = strnlen(argv[0], ETHER_ADDR_LEN+1 ); > + if ( m_size > ETHER_ADDR_LEN || m_size < 3 ) { > + warnx("mac address expression

Re: Bridge rules

2012-06-29 Thread sven falempin
compilable diff, ( i reboot new kernel and test userland l8r ) ifconfig bridge0 rule pass in on fxp0 src *:de:ff ifconfig bridge0 rule pass in on fxp0 src de:ff:* rantings time ~ Bret aint't no fool when it comes to the kernel do not make a mess ~ did it from tod

Re: Bridge rules

2012-06-29 Thread sven falempin
2012/6/29 Bret Lambert > Holy crap, you're doing this in a way too fucking complicated manner: > >for (i = 0; i < ETHER_ADDR_LEN; i++) >if (addr[i] != match[i] && match[i] != '*') >return (ENOTAMACTCH); > > Why do people want to cram useless shit where it doesn't want to b

Re: Bridge rules

2012-06-29 Thread sven falempin
Feel free to commit those code refactoring :) So, I have problem compiling my diff -for re mac bridge taging- for testing. ../../../../net/if_bridge.h:40:19: error: regex.h: No such file or directory but /usr/src/include/regex.h looks quite accessible .. # find /usr/src -type f -name regex.h /

Re: Bridge rules

2012-06-29 Thread Ted Unangst
On Fri, Jun 29, 2012 at 15:08, sven falempin wrote: > Code Rewriting (nothing new) and asking > > I seriously wonder if 'that' is good in sys/net/if_bridge.c > if (flags == 0) > goto return_action; > > Because if i m not wrong it could be rewritten this way (diff) That does look clearer to me.

Re: Bridge rules

2012-06-29 Thread sven falempin
Code Rewriting (nothing new) and asking I seriously wonder if 'that' is good in sys/net/if_bridge.c if (flags == 0) goto return_action; Because if i m not wrong it could be rewritten this way (diff) ---

Re: Bridge rules

2012-06-29 Thread sven falempin
2012/6/29 Henning Brauer > * Mike Belopuhov [2012-06-29 13:46]: > > On Fri, Jun 29, 2012 at 1:36 PM, Henning Brauer > > wrote: > > > now it's very unclear what your actual problem is - the struct is > > > called ifbreq and used in a number of places, most notably of course > > > the ioctls. > >

Re: Bridge rules

2012-06-29 Thread Henning Brauer
* Mike Belopuhov [2012-06-29 13:46]: > On Fri, Jun 29, 2012 at 1:36 PM, Henning Brauer > wrote: > > now it's very unclear what your actual problem is - the struct is > > called ifbreq and used in a number of places, most notably of course > > the ioctls. > he's trying to add patterns to the mac a

Re: Bridge rules

2012-06-29 Thread Mike Belopuhov
On Fri, Jun 29, 2012 at 1:36 PM, Henning Brauer wrote: > now it's very unclear what your actual problem is - the struct is > called ifbreq and used in a number of places, most notably of course > the ioctls. > he's trying to add patterns to the mac address matching code and pretends to be done wi

Re: Bridge rules

2012-06-29 Thread Henning Brauer
* sven falempin [2012-06-28 23:53]: > Doc : > > <> > Want to do something like > < OPENBSDAWESOME>> > or > < OPENBSDAWESOME>> > > Read Code : > found, in if_bridge.c (following SIOCBRDGARL from ifconfig) > << > bcopy(&req->ifbr_src, &n->brl_src, sizeof(struct ether_addr)); > bcopy(&req->ifbr_dst

Bridge rules

2012-06-28 Thread sven falempin
Doc : <> Want to do something like <> or <> Read Code : found, in if_bridge.c (following SIOCBRDGARL from ifconfig) << bcopy(&req->ifbr_src, &n->brl_src, sizeof(struct ether_addr)); bcopy(&req->ifbr_dst, &n->brl_dst, sizeof(struct ether_addr)); >> Search for usage of the (documented) field << fi