cvs commit: src/sbin/ifconfig iftrunk.c src/share/man/man4 trunk.4 src/sys/net ieee8023ad_lacp.c ieee8023ad_lacp.h if.c if_ethersubr.c if_trunk.c if_trunk.h if_var.h src/sys/sys priv.h

Andrew Thompson thompsa at freebsd.org
Tue Apr 10 09:20:11 UTC 2007


On Tue, Apr 10, 2007 at 12:31:31PM +0400, Gleb Smirnoff wrote:
>   Andrew and others,
> 
>   what do you think about using a flags fielf + union field for
> different kinds of glue? I mean that if_vlantrunk, if_trunk, if_bridge
> and may be some future glues are mutually exclusive.
> 
> If we put them under one union and add an integer field that identifies
> what is stored in the union, then we will:
> 
> 1) keep the structure smaller
> 2) structure won't grow in future, when adding more glues
> 3) easier to avoid bugs like attaching to bridge and vlan trunk
>    simultaneously

That could be good as thats already three pointers in the struct and im
sure the next pseudo interface type is just around the corner. A bit of
care would need to be taken to make sure that all the different
combinations of interfaces still work. For instance you can easily put
all three of those together in a valid config of trunk<-vlan<-bridge,
but for that each pointer would be on a different ifnet.


Andrew


More information about the cvs-src mailing list