Date: Sun, 25 Feb 2001 23:13:33 +0100 From: "Peter Blok" <Peter.Blok@inter.NL.net> To: "'C. Stephen Gunn'" <csg@waterspout.com> Cc: <freebsd-net@freebsd.org> Subject: RE: 802.1q vlans and STABLE Message-ID: <000601c09f78$31bff710$8a02a8c0@ntpc> In-Reply-To: <20010225170315.A50555@waterspout.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Steve, It is the order of initialization that causes this to happen. vlaninit happens before the hooks to ng_ether_attach_p are set. vlaninit is doing ether_ifattach, but without the hooks being called. Later on the first attempt to sent something (ARP) the code assumes ng_ether_attach has been called and crashes. Im am now changing the load order of ng_ether to load in an earlier stage. I am not quite sure why it is not going wrong everytime. I have two configs. The one that is working fine only loads the i4b stuff. The other doesn't. Peter -----Original Message----- From: C. Stephen Gunn [mailto:csg@waterspout.com] Sent: Sunday, February 25, 2001 23:03 To: Peter Blok Cc: freebsd-net@freebsd.org Subject: Re: 802.1q vlans and STABLE On Sun, Feb 25, 2001 at 04:46:47PM +0100, Peter Blok wrote: > The panic occurs in ng_ether_output, during the ifconfig of the first vlan > interface. It is coming from SIOCSIFADDR. It tries to do an arp request. The > reason of the the panic is NULL pointer to the netgraph structure. I am not > an expert to this code, but I believe this should have been done in > ng_ether_attach. > > I had difficulty re-producing this on my test machine, because the conf file > was different. In my configuration the attach is probably not done because I > don't have a couple of drivers configured in. Is it possible that the parent interface is not "ifconfig up" at the point you SIOCSIFADDR the vlan interface? Setting an address on an ethernet interface sets IFF_UP, in ether_ioctl(). So calling SIOCSIFADDR on the vlan interface eventually transmits an arp who-has on the parent interface (with 802.1q encap for the current VLAN of course) as a part of the AF_INET interface semantics. The problem is that unless you do an "ifconfig up" or some other "ifconfig" that results in if_init() getting called on the parent, some drivers (and sometimes NetGraph) aren't initialized. The vlan to arp_ifinit() -> parent->if_start() never verifies the interface is up. BOOM. I had a patch around somewhere that made vlan respect parent->if_flags, but I'm not sure where it went. I wasn't a good solution since the initial ARP who-has broadcasts were lost, which could confuse ARP handling sometimes, when there was an IP address conflict. Unfortunately I no longer work for Purdue U where I did the vlan stuff, and had a testing lab setup.. <sigh> - Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000601c09f78$31bff710$8a02a8c0>