Handling flags on vlan(4)

Yar Tikhiy yar at comp.chem.msu.su
Mon Jan 30 11:39:53 PST 2006


Hi folks,

Presently our vlan(4) driver sets interface's flags to 0 initially
and copies a subset of them from the parent interface when the vlan
interface is attached to its parent.  In particular, copied are flags
IFF_BROADCAST and IFF_MULTICAST.  This approach has an unpleasant
consequence: if you assign IP to vlan before attaching the latter to
its parent, IP won't be properly set up on vlanX because the IP code
does some special things for IFF_BROADCAST and IFF_MULTICAST
interfaces; at least it sets up a broadcast address and joins the
all-hosts group.

I can see two ways to deal with the problem.  The ideal and hard
way is to provide hooks to notify upper network stack layers of
changes in interface properties.  However, I doubt if such feature
is called for.  The easy and practical way is to set IFF_BROADCAST
and IFF_MULTICAST on vlan from the beginning and prohibit vlan from
attaching to a non-bcast or non-mcast parent (which wouldn't work
anyway.)

Any comments?

-- 
Yar


More information about the freebsd-net mailing list