PERFORCE change 124447 for review
Marko Zec
zec at icir.org
Wed Aug 1 12:07:14 UTC 2007
On Wednesday 01 August 2007 03:28, Julian Elischer wrote:
> there is a "really die" flag that should be used if a node may be
> associated with hardware, or for some other reason be persistent.
Thanks for the tip -> NGF_REALLY_DIE is now in
//depot/projects/vimage/src/sys/netgraph/ng_base.c#14
Marko
> /* Ask the type if it has anything to do in this case */
> if (node->nd_type && node->nd_type->shutdown) {
> (*node->nd_type->shutdown)(node);
> if (NG_NODE_IS_VALID(node)) {
> /*
> * Well, blow me down if the node code hasn't
> declared * that it doesn't want to die.
> * Presumably it is a persistent node.
> * If we REALLY want it to go away,
> * e.g. hardware going away,
> * Our caller should set NGF_REALLY_DIE in
> nd_flags. */
> node->nd_flags &= ~(NGF_INVALID|NGF_CLOSING);
> NG_NODE_UNREF(node); /* Assume they still
> have theirs */ return;
> }
> } else { /* do the default
> thing */ NG_NODE_UNREF(node);
> }
>
> > +#ifdef VIMAGE
> > +static int vnet_netgraph_idetach(const void *unused)
> > +{
> > + INIT_VNET_NETGRAPH(curvnet);
> > + node_p node, last_killed = NULL;
> > +
> > + while ((node = LIST_FIRST(&V_ng_nodelist)) != NULL) {
> > + if (node == last_killed)
> > + panic("netgraph node %s won't die", node->nd_name);
> > + ng_rmnode(node, NULL, NULL, 0);
> > + last_killed = node;
> > + }
> > +
> > + return 0;
> > +}
> > +#endif
> > +
> > static moduledata_t netgraph_mod = {
> > "netgraph",
> > ngb_mod_event,
More information about the p4-projects
mailing list