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

Function ng_pptpgre_disconnect

freebsd/netgraph/ng_pptpgre.c:528–555  ·  view source on GitHub ↗

* Hook disconnection */

Source from the content-addressed store, hash-verified

526 * Hook disconnection
527 */
528static int
529ng_pptpgre_disconnect(hook_p hook)
530{
531 const node_p node = NG_HOOK_NODE(hook);
532 const priv_p priv = NG_NODE_PRIVATE(node);
533 const hpriv_p hpriv = NG_HOOK_PRIVATE(hook);
534
535 /* Zero out hook pointer */
536 if (hook == priv->upper) {
537 priv->upper = NULL;
538 priv->uppersess.hook = NULL;
539 } else if (hook == priv->lower) {
540 priv->lower = NULL;
541 } else {
542 /* Reset node (stops timers) */
543 ng_pptpgre_reset(hpriv);
544
545 LIST_REMOVE(hpriv, sessions);
546 mtx_destroy(&hpriv->mtx);
547 free(hpriv, M_NETGRAPH);
548 }
549
550 /* Go away if no longer connected to anything */
551 if ((NG_NODE_NUMHOOKS(node) == 0)
552 && (NG_NODE_IS_VALID(node)))
553 ng_rmnode_self(node);
554 return (0);
555}
556
557/*
558 * Destroy node

Callers

nothing calls this directly

Calls 3

ng_pptpgre_resetFunction · 0.85
ng_rmnode_selfFunction · 0.70
freeFunction · 0.50

Tested by

no test coverage detected