diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -284,7 +284,7 @@ NG_NODE_SET_PRIVATE(node, sc); sc->node = node; - sc->snd_queue.ifq_maxlen = 2048; /* XXX not checked */ + sc->snd_queue.ifq_maxlen = 2048; ng_callout_init(&sc->intr_ch); return (0); @@ -567,8 +567,11 @@ } KASSERT(hook == sc->input, ("%s: no hook!", __func__)); - /* Enqueue packet. */ - /* XXX should we check IF_QFULL() ? */ + /* Enqueue packet if the queue isn't full. */ + if (_IF_QFULL(&sc->snd_queue)) { + NG_FREE_M(m); + return (ENOBUFS); + } _IF_ENQUEUE(&sc->snd_queue, m); sc->queueOctets += m->m_pkthdr.len; sc->last_packet = m;