diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_spppsubr.c | 15 | ||||
-rw-r--r-- | sys/net/ppp_tty.c | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index ac290b715d4..57cb5c8c45c 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.89 2011/07/05 20:01:40 henning Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.90 2011/07/05 21:11:36 guenther 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 = IFQ_IS_EMPTY(&sp->pp_fastq) && IFQ_IS_EMPTY(&sp->pp_cpq) && + empty = !sp->pp_fastq.ifq_head && !sp->pp_cpq.ifq_head && IFQ_IS_EMPTY(&sp->pp_if.if_snd); splx(s); return (empty); @@ -4535,7 +4535,16 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, HIDE void sppp_qflush(struct ifqueue *ifq) { - IFQ_PURGE(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; } /* diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 87c8de654bd..a448c335b62 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp_tty.c,v 1.21 2011/07/05 20:03:23 henning Exp $ */ +/* $OpenBSD: ppp_tty.c,v 1.22 2011/07/05 21:11:36 guenther Exp $ */ /* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */ /* @@ -311,7 +311,7 @@ pppread(tp, uio, flag) splx(s); return 0; } - if (!IFQ_IS_EMPTY(sc->sc_inq)) + if (sc->sc_inq.ifq_head != NULL) break; if ((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0 && (tp->t_state & TS_ISOPEN)) { |