From owner-freebsd-net Fri Jan 4 20:30: 7 2002 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 45BF937B419 for ; Fri, 4 Jan 2002 20:30:04 -0800 (PST) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id UAA64571; Fri, 4 Jan 2002 20:20:23 -0800 (PST) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g054KNx26451; Fri, 4 Jan 2002 20:20:23 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200201050420.g054KNx26451@arch20m.dellroad.org> Subject: Re: netgraph kernel panic In-Reply-To: <200201050335.g053ZFo26297@arch20m.dellroad.org> "from Archie Cobbs at Jan 4, 2002 07:35:15 pm" To: Archie Cobbs Date: Fri, 4 Jan 2002 20:20:23 -0800 (PST) Cc: Scott Lamb , freebsd-net@freebsd.org X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Archie Cobbs writes: > > Taking out my "set iface route" lines in mpd.conf made it no longer > > crash and I can talk to just the VPN host. So I tried next a "route add > > vpnhost mygw" before starting the VPN. It worked. So that's definitely > > the problem. It would be nice if there were a slicker way of doing this > > (mpd automatically adding that route if this situation occurs?), > > especially since I'm on DHCP. And it does make me nervous that mpd can > > make the kernel crash at all. But I can at least work around this now. > > You are right, kernel crashing is always bogus no matter how it > happens. Mpd adding a host route for the remote IP is a good idea, > I didn't think of that. I'll try to add something to that effect > when time permits. > > Really there are two things to fix: mpd as you describe, and > ng_ksocket, which is where the crash originates. If you have time, please try applying the patch below to your kernel. Leave the mpd configuration as it was, and let's see if we get a normal error instead of a kernel panic (I don't have a test setup for this myself just now). This is for FreeBSD-4.4, let me know if you have a different version. Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com --- netgraph/ng_ksocket.c.orig Fri Feb 16 09:37:48 2001 +++ netgraph/ng_ksocket.c Fri Jan 4 20:18:49 2002 @@ -72,8 +72,9 @@ /* Node private data */ struct ng_ksocket_private { - hook_p hook; - struct socket *so; + hook_p hook; /* our hook, if any */ + struct socket *so; /* our associated socket */ + u_int sending; /* writing to socket */ }; typedef struct ng_ksocket_private *priv_p; @@ -792,7 +793,13 @@ int error; NG_FREE_META(meta); + if (priv->sending) { + NG_FREE_DATA(m); + return (EDEADLK); + } + priv->sending++; error = (*so->so_proto->pr_usrreqs->pru_sosend)(so, 0, 0, m, 0, 0, p); + priv->sending--; return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message