diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2000-12-02 14:46:35 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2000-12-02 14:46:35 +0000 |
commit | c75134bf5e5afb3bd52f9a911441588e6b26da2d (patch) | |
tree | ceab762526d321f22f01b5bdc53f2e79b0b5b34f | |
parent | b28b13af9dc83c315c7ac7e54ec504533c4f7041 (diff) |
vlan devices should not try to emit packets if the parent interface is
not running and not up.
From NetBSD: move if_opackets to that it's incremented even if the parent
interface is oactive.
-rw-r--r-- | sys/net/if_vlan.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 662d81f6fbd..02d01ecd8ed 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.6 2000/10/18 15:55:48 chris Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.7 2000/12/02 14:46:34 jason Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology * @@ -194,6 +194,16 @@ vlan_start(struct ifnet *ifp) IF_DEQUEUE(&ifp->if_snd, m); if (m == 0) break; + + if ((p->if_flags & (IFF_UP|IFF_RUNNING)) != + (IFF_UP|IFF_RUNNING)) { + IF_DROP(&p->if_snd); + /* XXX stats */ + ifp->if_oerrors++; + m_freem(m); + continue; + } + #if NBPFILTER > 0 if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); @@ -267,10 +277,9 @@ vlan_start(struct ifnet *ifp) if (m->m_flags & M_MCAST) p->if_omcasts++; IF_ENQUEUE(&p->if_snd, m); - if ((p->if_flags & IFF_OACTIVE) == 0) { + ifp->if_opackets++; + if ((p->if_flags & IFF_OACTIVE) == 0) p->if_start(p); - ifp->if_opackets++; - } } ifp->if_flags &= ~IFF_OACTIVE; |