Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Aug 2010 12:42:30 -0500
From:      Brooks Davis <brooks@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        net@freebsd.org
Subject:   Re: vlan(4) interfaces have wrong interface type in sockaddr_dl address
Message-ID:  <20100803174230.GA87066@lor.one-eyed-alien.net>
In-Reply-To: <201008031217.27479.jhb@freebsd.org>
References:  <201008031029.11284.jhb@freebsd.org> <201008031217.27479.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--EVF5PPMfhYS0aIcm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 instea=
d of=20
> > IFT_L2VLAN in the sockaddr_dl that is returned by getifaddrs(3).  If yo=
u do a=20
> > route lookup for a route that goes across a vlan then the sockaddr_dl=
=20
> > generated for the routing message will specify IFT_L2VLAN (you can see =
it as=20
> > 'arp -a' shows [vlan] instead of [ethernet] for those routes).  However=
, the=20
> > address returned via getifaddrs(3) has a type of IFT_ETHER.  I think th=
is is a=20
> > bug of omission in that the vlan attach code needs to update the sockad=
dr_dl=20
> > that is initialized in ether_ifattach().  This patch does that and fixe=
s=20
> > getifaddrs(3).  Any objections?
>=20
> 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 commen=
ts
> that IFT_L2VLAN interfaces have a zero-length address (even though this c=
laim
> 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

--EVF5PPMfhYS0aIcm
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iD8DBQFMWFUFXY6L6fI4GtQRAtlJAJ9Hkm92at0kNSAUBupFQw2sF6s8jgCeMU3I
BobDKg6wslhAn4CzuYzYpsQ=
=wCM6
-----END PGP SIGNATURE-----

--EVF5PPMfhYS0aIcm--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100803174230.GA87066>