mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
netmap: Handle packet batches in generic mode
ifnets are allowed to pass batches of multiple packets to if_input, linked by the m_nextpkt pointer. iflib_rxeof() sometimes does this, for example. Netmap's generic mode did not handle this and would only deliver the first packet in the batch, leaking the rest. PR: 270636 Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39426
This commit is contained in:
parent
f401d82ef7
commit
5f6d37787f
|
@ -325,10 +325,17 @@ freebsd_generic_rx_handler(if_t ifp, struct mbuf *m)
|
|||
return;
|
||||
}
|
||||
|
||||
stolen = generic_rx_handler(ifp, m);
|
||||
if (!stolen) {
|
||||
NA(ifp)->if_input(ifp, m);
|
||||
}
|
||||
do {
|
||||
struct mbuf *n;
|
||||
|
||||
n = m->m_nextpkt;
|
||||
m->m_nextpkt = NULL;
|
||||
stolen = generic_rx_handler(ifp, m);
|
||||
if (!stolen) {
|
||||
NA(ifp)->if_input(ifp, m);
|
||||
}
|
||||
m = n;
|
||||
} while (m != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue