diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2008-04-24 11:36:40 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2008-04-24 11:36:40 +0000 |
commit | 7fc8437d1d2dff107fddd1e0381eb8f7e04bacf8 (patch) | |
tree | 67d55d2382c73604930294a8321e82940c22203b /sys/netinet | |
parent | 70364b8677ceef2632e6dae3fe8ceea29085596d (diff) |
the softnet intr handlers check if the input queue has packets on
it by reading the queues head pointer. if that pointer is not null
then it takes splnet and dequeues a packet for handling. this is
bad because the ifqueue head is modified at splnet and the sofnet
handlers read it without holding splnet.
this removes that check of the head pointer and simply checks if
the dequeue gave us a packet or not before proceeding.
found while reading mpls code.
discussed with norby@ and henning@
ok mcbride@ henning@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 4704fed67cc..d9220a22e16 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.70 2008/02/05 22:57:30 mpf Exp $ */ +/* $OpenBSD: if_ether.c,v 1.71 2008/04/24 11:36:38 dlg Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -469,7 +469,7 @@ arpintr() struct arphdr *ar; int s, len; - while (arpintrq.ifq_head) { + for (;;) { s = splnet(); IF_DEQUEUE(&arpintrq, m); splx(s); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 2b691ffa1ec..05b65ae94ef 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.157 2008/02/05 22:57:31 mpf Exp $ */ +/* $OpenBSD: ip_input.c,v 1.158 2008/04/24 11:36:38 dlg Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -226,7 +226,7 @@ ipintr() struct mbuf *m; int s; - while (ipintrq.ifq_head) { + for (;;) { /* * Get next datagram off input queue and get IP header * in first mbuf. @@ -234,7 +234,7 @@ ipintr() s = splnet(); IF_DEQUEUE(&ipintrq, m); splx(s); - if (m == 0) + if (m == NULL) return; #ifdef DIAGNOSTIC if ((m->m_flags & M_PKTHDR) == 0) |