FreeBSD/sys/netgraph/ng_pipe.c
/*
 * Shutdown processing
 *
 * This is tricky. If we have both a lower and upper hook, then we
 * probably want to extricate ourselves and leave the two peers
 * still linked to each other. Otherwise we should just shut down as
 * a normal node would.
 */
Shutdown processing
This is tricky. If we have both a lower and upper hook, then we
probably want to extricate ourselves and leave the two peers
still linked to each other. Otherwise we should just shut down as
a normal node would.
Shutdown processing This is tricky . If we have both a lower and upper hook then we probably want to extricate ourselves and leave the two peers still linked to each other . Otherwise we should just shut down as a normal node would .
static int
ngp_shutdown(node_p node)
{
	const priv_p priv = NG_NODE_PRIVATE(node);
	if (priv->timer_scheduled)
		ng_uncallout(&priv->timer, node);
	if (priv->lower.hook && priv->upper.hook)
		ng_bypass(priv->lower.hook, priv->upper.hook);
	else {
		if (priv->upper.hook != NULL)
			ng_rmhook_self(priv->upper.hook);
		if (priv->lower.hook != NULL)
			ng_rmhook_self(priv->lower.hook);
	}
	NG_NODE_UNREF(node);
	free(priv, M_NG_PIPE);
	return (0);
}
static int ngp_shutdown ( node_p node ) { const priv_p priv = NG_NODE_PRIVATE ( node ) ; if ( priv -> timer_scheduled ) ng_uncallout ( & priv -> timer , node ) ; if ( priv -> lower . hook && priv -> upper . hook ) ng_bypass ( priv -> lower . hook , priv -> upper . hook ) ; else { if ( priv -> upper . hook != NULL ) ng_rmhook_self ( priv -> upper . hook ) ; if ( priv -> lower . hook != NULL ) ng_rmhook_self ( priv -> lower . hook ) ; } NG_NODE_UNREF ( node ) ; free ( priv , M_NG_PIPE ) ; return ( 0 ) ; }
Shutdown processing
 This is tricky.
Shutdown processing This is tricky .