summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_base.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-06-25 21:11:14 +0000
committerjulian <julian@FreeBSD.org>2004-06-25 21:11:14 +0000
commitcf606d5f29ba03ae7d84a2c5e7458dbfb7db2d36 (patch)
tree64aaf07e387c6e0f8cc1eae22b2a1376c18d7014 /sys/netgraph/ng_base.c
parent2cf7db632c6326199a2eec3a4d6b3ee8f4acac92 (diff)
downloadFreeBSD-src-cf606d5f29ba03ae7d84a2c5e7458dbfb7db2d36.zip
FreeBSD-src-cf606d5f29ba03ae7d84a2c5e7458dbfb7db2d36.tar.gz
Make the frameworkl responsible for not passing the nodes a NULL mbuf pointer.
this allows the nodes to not test for this.. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
Diffstat (limited to 'sys/netgraph/ng_base.c')
-rw-r--r--sys/netgraph/ng_base.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index f50f5f2..0616176 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -2139,6 +2139,13 @@ ng_snd_item(item_p item, int queue)
* the node is derivable from the hook.
* References are held on both by the item.
*/
+
+ /* Protect nodes from sending NULL pointers
+ * to each other
+ */
+ if (m == NULL)
+ return (EINVAL);
+
CHECK_DATA_MBUF(NGI_M(item));
if (hook == NULL) {
NG_FREE_ITEM(item);
OpenPOWER on IntegriCloud