Remove a recursion protection, which we inherited from splnet() netgraph times.

Now several threads may write data to ng_ksocket. Locking of socket is done in
sosend().

Reviewed by:	archie, julian, rwatson
MFC after:	2 weeks
This commit is contained in:
Gleb Smirnoff 2005-02-16 16:00:35 +00:00
parent 55cf7be1ab
commit 848a25c773
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141971

View File

@ -96,7 +96,6 @@ typedef struct ng_ksocket_private *priv_p;
#define KSF_EOFSEEN 0x00000004 /* Have sent 0-length EOF mbuf */
#define KSF_CLONED 0x00000008 /* Cloned from an accepting socket */
#define KSF_EMBRYONIC 0x00000010 /* Cloned node with no hooks yet */
#define KSF_SENDING 0x00000020 /* Sending on socket */
/* Netgraph node methods */
static ng_constructor_t ng_ksocket_constructor;
@ -898,12 +897,6 @@ ng_ksocket_rcvdata(hook_p hook, item_p item)
struct mbuf *m;
struct sa_tag *stag;
/* Avoid reentrantly sending on the socket */
if ((priv->flags & KSF_SENDING) != 0) {
NG_FREE_ITEM(item);
return (EDEADLK);
}
/* Extract data */
NGI_GET_M(item, m);
NG_FREE_ITEM(item);
@ -919,9 +912,7 @@ ng_ksocket_rcvdata(hook_p hook, item_p item)
sa = &stag->sa;
/* Send packet */
priv->flags |= KSF_SENDING;
error = (*so->so_proto->pr_usrreqs->pru_sosend)(so, sa, 0, m, 0, 0, td);
priv->flags &= ~KSF_SENDING;
return (error);
}