diff options
author | 2017-01-04 03:42:33 +0000 | |
---|---|---|
committer | 2017-01-04 03:42:33 +0000 | |
commit | e73212cc65e8790333684482254f8a3e500c626f (patch) | |
tree | 90d7f41e8174d127bf4238d07469d0a175a22405 | |
parent | s/Signaled/Signalled/ (diff) | |
download | wireguard-openbsd-e73212cc65e8790333684482254f8a3e500c626f.tar.xz wireguard-openbsd-e73212cc65e8790333684482254f8a3e500c626f.zip |
shuffle the last change slightly.
only check ml_empty the second time if bpf was run and may have
filtered the list.
only call task_add if mq_enlist worked.
-rw-r--r-- | sys/net/if.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 9c4c639ede8..4381f2abd5c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.471 2017/01/04 03:12:54 dlg Exp $ */ +/* $OpenBSD: if.c,v 1.472 2017/01/04 03:42:33 dlg Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -651,14 +651,14 @@ if_input(struct ifnet *ifp, struct mbuf_list *ml) else ml_enqueue(ml, m); } - } - if (ml_empty(ml)) - return; + if (ml_empty(ml)) + return; + } #endif - mq_enlist(&ifp->if_inputqueue, ml); - task_add(softnettq, ifp->if_inputtask); + if (mq_enlist(&ifp->if_inputqueue, ml) == 0) + task_add(softnettq, ifp->if_inputtask); } int |