svn commit: r248067 - stable/8/sys/netgraph

Ryan Stone rstone at
Fri Mar 8 19:36:45 UTC 2013

Author: rstone
Date: Fri Mar  8 19:36:44 2013
New Revision: 248067

  MFC r241009
    Ensure that all cases that enqueue a netgraph item for delivery by a
    ngthread properly set the item's depth to 1.  In particular, prior to this
    change if ng_snd_item failed to acquire a lock on a node, the item's depth
    would not be set at all.  This fix ensures that the error code from rcvmsg/
    rcvdata is properly passed back to the apply callback.  For example, this
    fixes a bug where an error from rcvmsg/rcvdata would not previously
    propagate back to a libnetgraph consumer when the message was queued.
    Reviewed by:  mav
    MFC after:    1 month
    Sponsored by: Sandvine Incorporated

Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/netgraph/   (props changed)

Modified: stable/8/sys/netgraph/ng_base.c
--- stable/8/sys/netgraph/ng_base.c	Fri Mar  8 19:36:36 2013	(r248066)
+++ stable/8/sys/netgraph/ng_base.c	Fri Mar  8 19:36:44 2013	(r248067)
@@ -1947,6 +1947,7 @@ ng_queue_rw(node_p node, item_p  item, i
+	item->depth = 1;
 	/* Set OP_PENDING flag and enqueue the item. */
@@ -2225,7 +2226,6 @@ ng_snd_item(item_p item, int flags)
 	if (queue) {
-		item->depth = 1;
 		/* Put it on the queue for that node*/
 		ng_queue_rw(node, item, rw);
 		return ((flags & NG_PROGRESS) ? EINPROGRESS : 0);

More information about the svn-src-stable-8 mailing list