Page MenuHomeFreeBSD

D23477.diff
No OneTemporary

D23477.diff

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;

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 6, 5:23 AM (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13707069
Default Alt Text
D23477.diff (713 B)

Event Timeline