diff --git a/sys/netgraph/ng_one2many.c b/sys/netgraph/ng_one2many.c index 66f3a947f49c..ca742b3dc959 100644 --- a/sys/netgraph/ng_one2many.c +++ b/sys/netgraph/ng_one2many.c @@ -331,7 +331,7 @@ ng_one2many_rcvmsg(node_p node, item_p item, hook_p lasthook) linkNum = *((int32_t *)msg->data); if (linkNum == NG_ONE2MANY_ONE_LINKNUM) link = &priv->one; - else if (linkNum == 0 + else if (linkNum >= 0 && linkNum < NG_ONE2MANY_MAX_LINKS) { link = &priv->many[linkNum]; } else {