From owner-freebsd-stable Thu Aug 30 8:59: 6 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mail.chem.msu.ru (mail.chem.msu.ru [195.208.208.19]) by hub.freebsd.org (Postfix) with ESMTP id CEDA437B403; Thu, 30 Aug 2001 08:58:57 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su ([158.250.32.97]) by mail.chem.msu.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id Q5PY2J2J; Thu, 30 Aug 2001 19:48:27 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f7UFw0623395; Thu, 30 Aug 2001 19:58:00 +0400 (MSD) (envelope-from yar) Date: Thu, 30 Aug 2001 19:58:00 +0400 From: Yar Tikhiy To: Archie Cobbs Cc: Mike Tancsa , stable@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: kernel panic when bringing up a VLAN interface (netgraph?) Message-ID: <20010830195759.A21176@comp.chem.msu.su> References: <20010829214910.A204@comp.chem.msu.su> <200108292247.f7TMl6i40209@arch20m.dellroad.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200108292247.f7TMl6i40209@arch20m.dellroad.org>; from archie@dellroad.org on Wed, Aug 29, 2001 at 03:47:06PM -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [adding -net to the Cc: list] On Wed, Aug 29, 2001 at 03:47:06PM -0700, Archie Cobbs wrote: > Yar Tikhiy writes: > > Why does gdb report the values of "ifp" and "mp" inconsistently? > > The kernel crashed at the first line of ng_ether_output(), so > > the arguments couldn't be modified... I'm confused. > > Optimization.. it's probably reusing the same variable/register for > both 'ifp' and 'node'. So 'node' is NULL, which indicates that > ether_ifattach() was probably never called on this interface. Yes it was. As I've just traced, it's ng_ether_mod_event() that is responsible for the panic. When ng_ether is being loaded as a module, or just initialized as a part of a kernel, it attaches all existing ethernet interfaces to netgraph using ng_ether_attach(). However, the vlan interface has a different type, IFT_L2VLAN, so it won't get attached to netgraph properly. On the other hand, vlan can't attach to netgraph by itself because its init function is usually called earlier that that of ng_ether. Peter Block on -net reported that he had avoided the panic by fiddling with initialization order. However, that was a hack, not a solution. I'd suggest the following fix. Not sure if it should be pushed into the upcoming 4.4-RELEASE... Index: ng_ether.c =================================================================== RCS file: /home/ncvs/src/sys/netgraph/ng_ether.c,v retrieving revision 1.18 diff -u -r1.18 ng_ether.c --- ng_ether.c 2001/01/30 20:51:52 1.18 +++ ng_ether.c 2001/08/30 15:33:24 @@ -798,7 +798,8 @@ /* Create nodes for any already-existing Ethernet interfaces */ TAILQ_FOREACH(ifp, &ifnet, if_link) { - if (ifp->if_type == IFT_ETHER) + if (ifp->if_type == IFT_ETHER || + ifp->if_type == IFT_L2VLAN) ng_ether_attach(ifp); } break; -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message