From owner-freebsd-net@FreeBSD.ORG Mon Dec 20 17:10:16 2010 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 274C61065670; Mon, 20 Dec 2010 17:10:16 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (unknown [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF2E8FC15; Mon, 20 Dec 2010 17:10:15 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id AB5CC39824; Mon, 20 Dec 2010 19:10:12 +0200 (SAST) Date: Mon, 20 Dec 2010 19:10:12 +0200 From: John Hay To: Hiroki Sato Message-ID: <20101220171012.GB86149@zibbi.meraka.csir.co.za> References: <20101220061057.GA36160@zibbi.meraka.csir.co.za> <201012200807.57670.jhb@freebsd.org> <20101221.005458.144703395.hrs@allbsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101221.005458.144703395.hrs@allbsd.org> User-Agent: Mutt/1.4.2.3i Cc: jhay@FreeBSD.org, jhb@FreeBSD.org, freebsd-net@FreeBSD.org Subject: Re: IFT_L2VLAN and IPv6 link-local addresses 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: Mon, 20 Dec 2010 17:10:16 -0000 Hi Hiroki, On Tue, Dec 21, 2010 at 12:54:58AM +0900, Hiroki Sato wrote: > John Baldwin wrote > in <201012200807.57670.jhb@freebsd.org>: > > jh> On Monday, December 20, 2010 1:10:57 am John Hay wrote: > jh> > Hi, > jh> > > jh> > I see that on FreeBSD-8 if you use IPv6 inside vlans, the local part of > jh> > the address (bottom 64 bits) is based on the MAC address of the first > jh> > ethernet interface on the system. It was not like this in my old -7, > jh> > machine, so I looked around a bit. It looks like it is because vlans were > jh> > changed to report their type as IFT_L2VLAN. So I made this patch to the > jh> > IPv6 code that fix it for me: > jh> > > jh> > Index: sys/netinet6/in6_ifattach.c > jh> > =================================================================== > jh> > RCS file: /home/ncvs/src/sys/netinet6/in6_ifattach.c,v > jh> > retrieving revision 1.74.2.3 > jh> > diff -u -U 5 -r1.74.2.3 in6_ifattach.c > jh> > --- sys/netinet6/in6_ifattach.c 6 May 2010 06:44:19 -0000 1.74.2.3 > jh> > +++ sys/netinet6/in6_ifattach.c 15 Dec 2010 18:33:45 -0000 > jh> > @@ -265,10 +265,11 @@ > jh> > addrlen = sdl->sdl_alen; > jh> > > jh> > /* get EUI64 */ > jh> > switch (ifp->if_type) { > jh> > case IFT_ETHER: > jh> > + case IFT_L2VLAN: > jh> > case IFT_FDDI: > jh> > case IFT_ISO88025: > jh> > case IFT_ATM: > jh> > case IFT_IEEE1394: > jh> > #ifdef IFT_IEEE80211 > jh> > > jh> > Anything against me committing it? Am I missing something? Should it be > jh> > sorted differently? Should it also be merged? > jh> > jh> This looks correct. Please fix and MFC. I haven't merged the kernel changes > jh> to change the type of IFT_ for vlan's yet as I was worried about applications > jh> such as this needing to be updated (such as dhcpd for example). I had thought > jh> that I had not merged the kernel change to 8 though, that it was just in 9? > > Agreed with the fix, but I think both 7.X and 8.X pick the first IF's > address anyway. Which log message did you get, "borrow interface > identifier from..." or "...got interface identifier from itself" > when net.inet6.icmp6.nd6_debug=1 on 7.X and 8.X, respectively? You are correct. I forgot that in the 7.x network layout, the ipv6 networks were not in vlans. I just tried it on my old 7.2-PRE box: sysctl net.inet6.icmp6.nd6_debug=1 ifconfig vlan0 create vlandev em2 vlan 1200 ifconfig vlan0 up ifconfig vlan0 vlan0: flags=8843 metric 0 mtu 1500 options=3 ether 00:11:43:dc:fd:78 inet6 fe80::21b:21ff:fe13:2650%vlan0 prefixlen 64 tentative scopeid 0x6 media: Ethernet autoselect (1000baseTX ) status: active vlan: 1200 parent interface: em2 The last part of dmesg: vlan0: borrow interface identifier from em0 vlan0: ifid: 02:1b:21:ff:fe:13:26:50 vlan0: starting DAD for fe80:6::21b:21ff:fe13:2650 vlan0: DAD complete for fe80:6::21b:21ff:fe13:2650 - no duplicates found I also had a better look at if_vlan.c. John's IFT_L2VLAN changes has not been merged, as he remembered. :-) The line ifp->if_type = IFT_L2VLAN; has been there for a long time and his changes only change sdl->sdl_type in any case. John -- John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org