dummynet: dn_dequeue() may return NULL
If there are no more entries, or if we fail to restore the rcvif of a queued mbuf dn_dequeue() can return NULL. Cope with this. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34078
This commit is contained in:
parent
703e533da5
commit
9dac026822
@ -243,6 +243,8 @@ wf2qp_dequeue(struct dn_sch_inst *_si)
|
||||
q = HEAP_TOP(sch)->object;
|
||||
alg_fq = (struct wf2qp_queue *)q;
|
||||
m = dn_dequeue(q);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
heap_extract(sch, NULL); /* Remove queue from heap. */
|
||||
si->V += (uint64_t)(m->m_pkthdr.len) * si->inv_wsum;
|
||||
alg_fq->S = alg_fq->F; /* Update start time. */
|
||||
|
Loading…
Reference in New Issue
Block a user