summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2020-06-24 08:52:54 +0000
committermvs <mvs@cvs.openbsd.org>2020-06-24 08:52:54 +0000
commit86060a6db12ecf94f4bbdedf24365ff10f74e44c (patch)
tree6a69ac3958069ec664d733ede8b5619cffc797c6
parent36e79b4ec8f2c0477bb87a0c07afa43c624ca1f8 (diff)
Fix `IFF_RUNNING' bit handling for pppx(4) and pppac(4).
ok mpi@
-rw-r--r--sys/net/if_pppx.c10
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) {