vlan(4) interfaces have wrong interface type in sockaddr_dl address

Brooks Davis brooks at freebsd.org
Tue Aug 3 17:57:31 UTC 2010


On Tue, Aug 03, 2010 at 12:17:27PM -0400, John Baldwin wrote:
> On Tuesday, August 03, 2010 10:29:11 am John Baldwin wrote:
> > Currently vlan(4) interfaces have an interface type of IFT_ETHER instead of 
> > IFT_L2VLAN in the sockaddr_dl that is returned by getifaddrs(3).  If you do a 
> > route lookup for a route that goes across a vlan then the sockaddr_dl 
> > generated for the routing message will specify IFT_L2VLAN (you can see it as 
> > 'arp -a' shows [vlan] instead of [ethernet] for those routes).  However, the 
> > address returned via getifaddrs(3) has a type of IFT_ETHER.  I think this is a 
> > bug of omission in that the vlan attach code needs to update the sockaddr_dl 
> > that is initialized in ether_ifattach().  This patch does that and fixes 
> > getifaddrs(3).  Any objections?
> 
> A few places in userland also need fixing to catch up to this I think.  I did
> not patch getnameinfo(3) in libc since it explicitly claims in the comments
> that IFT_L2VLAN interfaces have a zero-length address (even though this claim
> is false in practice).  Updated patch:

This seems like the right thing to do.  I might suggest merging the
userspace changes well before the kernel changes or the results may be
confusing.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20100803/cebc0add/attachment.pgp


More information about the freebsd-net mailing list