diff options
author | 2020-06-24 08:52:53 +0000 | |
---|---|---|
committer | 2020-06-24 08:52:53 +0000 | |
commit | e9c5ed46e587a6d6ccf00bda5c35b9cacad74d63 (patch) | |
tree | f6aeff44d7ce2d69ef3a84eb37ad71ea90719958 | |
parent | Apply sc->sc_xfer_flags to control transfers as well. These are used (diff) | |
download | wireguard-openbsd-e9c5ed46e587a6d6ccf00bda5c35b9cacad74d63.tar.xz wireguard-openbsd-e9c5ed46e587a6d6ccf00bda5c35b9cacad74d63.zip |
Fix `IFF_RUNNING' bit handling for pppx(4) and pppac(4).
ok mpi@
-rw-r--r-- | sys/net/if_pppx.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 4c5cb972caa..a6fc3bbd1e2 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.89 2020/06/22 10:01:03 mvs Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.90 2020/06/24 08:52:53 mvs Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -854,9 +854,10 @@ pppx_if_destroy(struct pppx_dev *pxd, struct pppx_if *pxi) struct pipex_session *session; NET_ASSERT_LOCKED(); - pxi->pxi_ready = 0; session = pxi->pxi_session; ifp = &pxi->pxi_if; + pxi->pxi_ready = 0; + CLR(ifp->if_flags, IFF_RUNNING); pipex_unlink_session(session); @@ -910,7 +911,7 @@ pppx_if_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, NET_ASSERT_LOCKED(); - if (!ISSET(ifp->if_flags, IFF_UP)) { + if (!ISSET(ifp->if_flags, IFF_RUNNING)) { m_freem(m); error = ENETDOWN; goto out; @@ -1466,6 +1467,9 @@ pppac_start(struct ifnet *ifp) struct pppac_softc *sc = ifp->if_softc; struct mbuf *m; + if (!ISSET(ifp->if_flags, IFF_RUNNING)) + return; + while ((m = ifq_dequeue(&ifp->if_snd)) != NULL) { #if NBPFILTER > 0 if (ifp->if_bpf) { |