From owner-freebsd-net@FreeBSD.ORG Tue Aug 3 17:57:31 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD4241065673 for ; Tue, 3 Aug 2010 17:57:31 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 475178FC13 for ; Tue, 3 Aug 2010 17:57:30 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o73HgU79087656; Tue, 3 Aug 2010 12:42:30 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o73HgUmf087655; Tue, 3 Aug 2010 12:42:30 -0500 (CDT) (envelope-from brooks) Date: Tue, 3 Aug 2010 12:42:30 -0500 From: Brooks Davis To: John Baldwin Message-ID: <20100803174230.GA87066@lor.one-eyed-alien.net> References: <201008031029.11284.jhb@freebsd.org> <201008031217.27479.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <201008031217.27479.jhb@freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 03 Aug 2010 12:42:30 -0500 (CDT) Cc: net@freebsd.org Subject: Re: vlan(4) interfaces have wrong interface type in sockaddr_dl address X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2010 17:57:31 -0000 --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--