PERFORCE change 128368 for review

Marko Zec zec at FreeBSD.org
Tue Oct 30 14:13:40 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=128368

Change 128368 by zec at zec_tpx32 on 2007/10/30 21:13:05

	In ng_pipe, drop a refcount to our own node on node shutdown,
	otherwise the node would remain a zombie invisible by
	"ngctl list".  This was relatively benign for ng_pipe nodes
	living in the default vnet, but would lead to a panic
	on attempts to destroy a vnet with at least one such a zombie
	hanging in there.
	
	While here, remove an unused field in node_priv struct, and
	rename ngp_rmnode() -> ngp_shutdown().

Affected files ...

.. //depot/projects/vimage/src/sys/netgraph/ng_pipe.c#5 edit

Differences ...

==== //depot/projects/vimage/src/sys/netgraph/ng_pipe.c#5 (text+ko) ====

@@ -96,7 +96,6 @@
 
 /* Per node info */
 struct node_priv {
-	node_p			node;
 	u_int64_t		delay;
 	u_int32_t		overhead;
 	u_int32_t		header_offset;
@@ -147,7 +146,7 @@
 /* Netgraph methods */
 static ng_constructor_t	ngp_constructor;
 static ng_rcvmsg_t	ngp_rcvmsg;
-static ng_shutdown_t	ngp_rmnode;
+static ng_shutdown_t	ngp_shutdown;
 static ng_newhook_t	ngp_newhook;
 static ng_rcvdata_t	ngp_rcvdata;
 static ng_disconnect_t	ngp_disconnect;
@@ -246,7 +245,7 @@
 	.name =		NG_PIPE_NODE_TYPE,
 	.mod_event =	ngp_modevent,
 	.constructor =	ngp_constructor,
-	.shutdown =	ngp_rmnode,
+	.shutdown =	ngp_shutdown,
 	.rcvmsg =	ngp_rcvmsg,
 	.newhook =	ngp_newhook,
 	.rcvdata =	ngp_rcvdata,
@@ -945,7 +944,7 @@
  * a normal node would.
  */
 static int
-ngp_rmnode(node_p node)
+ngp_shutdown(node_p node)
 {
 	const priv_p priv = NG_NODE_PRIVATE(node);
 
@@ -957,6 +956,7 @@
 		if (priv->lower.hook != NULL)
 			ng_rmhook_self(priv->lower.hook);
 	}
+	NG_NODE_UNREF(node);
 	FREE(priv, M_NG_PIPE);
 	return (0);
 }


More information about the p4-projects mailing list