Date: Thu, 27 Sep 2012 20:12:51 +0000 (UTC) From: Ryan Stone <rstone@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241009 - head/sys/netgraph Message-ID: <201209272012.q8RKCp68090272@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rstone Date: Thu Sep 27 20:12:51 2012 New Revision: 241009 URL: http://svn.freebsd.org/changeset/base/241009 Log: 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 Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Sep 27 20:06:37 2012 (r241008) +++ head/sys/netgraph/ng_base.c Thu Sep 27 20:12:51 2012 (r241009) @@ -2008,6 +2008,7 @@ ng_queue_rw(node_p node, item_p item, i NGI_SET_WRITER(item); else NGI_SET_READER(item); + item->depth = 1; NG_QUEUE_LOCK(ngq); /* Set OP_PENDING flag and enqueue the item. */ @@ -2286,7 +2287,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209272012.q8RKCp68090272>