Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102118633
D42636.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
941 B
Referenced Files
None
Subscribers
None
D42636.diff
View Options
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -929,17 +929,24 @@
ng_ksocket_shutdown(node_p node)
{
const priv_p priv = NG_NODE_PRIVATE(node);
+ struct socket *so = priv->so;
priv_p embryo;
/* Close our socket (if any) */
if (priv->so != NULL) {
- SOCKBUF_LOCK(&priv->so->so_rcv);
- soupcall_clear(priv->so, SO_RCV);
- SOCKBUF_UNLOCK(&priv->so->so_rcv);
- SOCKBUF_LOCK(&priv->so->so_snd);
- soupcall_clear(priv->so, SO_SND);
- SOCKBUF_UNLOCK(&priv->so->so_snd);
- soclose(priv->so);
+ if (SOLISTENING(so)) {
+ SOLISTEN_LOCK(so);
+ solisten_upcall_set(so, NULL, NULL);
+ SOLISTEN_UNLOCK(so);
+ } else {
+ SOCK_RECVBUF_LOCK(so);
+ soupcall_clear(so, SO_RCV);
+ SOCK_RECVBUF_UNLOCK(so);
+ SOCK_SENDBUF_LOCK(so);
+ soupcall_clear(so, SO_SND);
+ SOCK_SENDBUF_UNLOCK(so);
+ }
+ soclose(so);
priv->so = NULL;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 8:36 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14542301
Default Alt Text
D42636.diff (941 B)
Attached To
Mode
D42636: ng_ksocket: fix upcall clearing on node shutdown
Attached
Detach File
Event Timeline
Log In to Comment