From owner-freebsd-net Sun Feb 25 14:10:59 2001 Delivered-To: freebsd-net@freebsd.org Received: from dustdevil.waterspout.com (pm01p04.wintek.com [206.230.3.84]) by hub.freebsd.org (Postfix) with ESMTP id 2451637B401 for ; Sun, 25 Feb 2001 14:10:56 -0800 (PST) (envelope-from csg@waterspout.com) Received: from waterspout.com (csg@localhost [127.0.0.1]) by dustdevil.waterspout.com (8.11.1/8.11.2) with ESMTP id f1PMBgc51779; Sun, 25 Feb 2001 17:11:43 -0500 (EST) (envelope-from csg@waterspout.com) Message-Id: <200102252211.f1PMBgc51779@dustdevil.waterspout.com> To: Peter Blok Cc: freebsd-net@freebsd.org From: "C. Stephen Gunn" Subject: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <51774.983139091.1@waterspout.com> Date: Sun, 25 Feb 2001 17:11:31 -0500 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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.. - Steve -- C. Stephen Gunn | Waterspout Communications, Inc. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message