summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2011-07-05 20:01:40 +0000
committerhenning <henning@openbsd.org>2011-07-05 20:01:40 +0000
commit2b2bda1e48035af034569ddd1dfa9e34e99e8878 (patch)
tree3bee90141b5b6bed8bb1fed2236d83902d5218dd
parentRemove a broken optimization found by the new pool_chk code. It (diff)
downloadwireguard-openbsd-2b2bda1e48035af034569ddd1dfa9e34e99e8878.tar.xz
wireguard-openbsd-2b2bda1e48035af034569ddd1dfa9e34e99e8878.zip
2 cases of IFQ_IS_EMPTY instead of mucking with ifqueue internals
make sppp_flush use IFQ_PURGE instead of handrolling the same making assumptions about ifqueue internals. ok ryan claudio
-rw-r--r--sys/net/if_spppsubr.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 519b08904cd..ac290b715d4 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.88 2011/06/29 12:14:46 tedu Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.89 2011/07/05 20:01:40 henning Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -1012,7 +1012,7 @@ sppp_isempty(struct ifnet *ifp)
int empty, s;
s = splnet();
- empty = !sp->pp_fastq.ifq_head && !sp->pp_cpq.ifq_head &&
+ empty = IFQ_IS_EMPTY(&sp->pp_fastq) && IFQ_IS_EMPTY(&sp->pp_cpq) &&
IFQ_IS_EMPTY(&sp->pp_if.if_snd);
splx(s);
return (empty);
@@ -4535,16 +4535,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
HIDE void
sppp_qflush(struct ifqueue *ifq)
{
- struct mbuf *m, *n;
-
- n = ifq->ifq_head;
- while ((m = n)) {
- n = m->m_act;
- m_freem (m);
- }
- ifq->ifq_head = 0;
- ifq->ifq_tail = 0;
- ifq->ifq_len = 0;
+ IFQ_PURGE(ifq);
}
/*