Date: Sat, 5 Jan 2002 13:20:52 -0600 From: Scott Lamb <slamb@slamb.org> To: Archie Cobbs <archie@dellroad.org> Cc: freebsd-net@freebsd.org Subject: Re: netgraph kernel panic Message-ID: <20020105192052.GA1739@cairo.zsat.net> In-Reply-To: <200201050420.g054KNx26451@arch20m.dellroad.org> References: <200201050335.g053ZFo26297@arch20m.dellroad.org> <200201050420.g054KNx26451@arch20m.dellroad.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 04, 2002 at 08:20:23PM -0800, Archie Cobbs wrote:
> 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).
Yep. I get this message when I don't add that route:
[work] error writing len 12 frame to bypass: Resource deadlock
avoided
and it still works when I do add the route.
> This is for FreeBSD-4.4, let me know if you have a different version.
I'm following RELENG-4 (which calls itself 4.5-PRERELEASE now), so your
patch didn't apply quite cleanly. Below is what I used (which likely
isn't quite right).
Thanks,
Scott Lamb
Index: netgraph/ng_ksocket.c
===================================================================
RCS file: /home/ncvs/src/sys/netgraph/ng_ksocket.c,v
retrieving revision 1.5.2.8
diff -u -r1.5.2.8 ng_ksocket.c
--- netgraph/ng_ksocket.c 2001/12/07 02:59:20 1.5.2.8
+++ netgraph/ng_ksocket.c 2002/01/05 19:18:24
@@ -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;
@@ -810,7 +811,13 @@
}
/* Send packet */
+ if (priv->sending) {
+ NG_FREE_DATA(m, meta);
+ return (EDEADLK);
+ }
+ priv->sending++;
error = (*so->so_proto->pr_usrreqs->pru_sosend)(so, sa, 0, m, 0, 0, p);
+ priv->sending--;
/* Clean up and exit */
NG_FREE_META(meta);
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?20020105192052.GA1739>
