openbsd_network: Refactor if_input_openbsd to use ml_dequeue.
Should not be any functional change.
This commit is contained in:
@@ -12,25 +12,14 @@
|
|||||||
static inline int
|
static inline int
|
||||||
if_input_openbsd(if_t ifp, struct mbuf_list* ml)
|
if_input_openbsd(if_t ifp, struct mbuf_list* ml)
|
||||||
{
|
{
|
||||||
if (ml_empty(ml))
|
struct mbuf* m;
|
||||||
return 0;
|
|
||||||
|
|
||||||
struct mbuf* mb = ml->ml_head, *next = NULL;
|
|
||||||
int status = 0;
|
int status = 0;
|
||||||
while (mb != NULL) {
|
while ((m = ml_dequeue(ml)) != NULL) {
|
||||||
// if_input takes only the first packet, it ignores mb->m_nextpkt.
|
status = if_input(ifp, m);
|
||||||
next = mb->m_nextpkt;
|
|
||||||
status = if_input(ifp, mb);
|
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
mb = next;
|
|
||||||
next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next != NULL)
|
|
||||||
m_freem(next);
|
|
||||||
ml_init(ml);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#define if_input if_input_openbsd
|
#define if_input if_input_openbsd
|
||||||
|
|||||||
Reference in New Issue
Block a user