MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngs_shutdown

Function ngs_shutdown

freebsd/netgraph/ng_socket.c:1084–1106  ·  view source on GitHub ↗

* Do local shutdown processing. * In this case, that involves making sure the socket * knows we should be shutting down. */

Source from the content-addressed store, hash-verified

1082 * knows we should be shutting down.
1083 */
1084static int
1085ngs_shutdown(node_p node)
1086{
1087 struct ngsock *const priv = NG_NODE_PRIVATE(node);
1088 struct ngpcb *dpcbp, *pcbp;
1089
1090 mtx_lock(&priv->mtx);
1091 dpcbp = priv->datasock;
1092 pcbp = priv->ctlsock;
1093
1094 if (dpcbp != NULL)
1095 soisdisconnected(dpcbp->ng_socket);
1096
1097 if (pcbp != NULL)
1098 soisdisconnected(pcbp->ng_socket);
1099
1100 priv->node = NULL;
1101 NG_NODE_SET_PRIVATE(node, NULL);
1102 ng_socket_free_priv(priv);
1103
1104 NG_NODE_UNREF(node);
1105 return (0);
1106}
1107
1108static void
1109ng_socket_item_applied(void *context, int error)

Callers

nothing calls this directly

Calls 3

soisdisconnectedFunction · 0.85
ng_socket_free_privFunction · 0.85
mtx_lockFunction · 0.50

Tested by

no test coverage detected