summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-04-27 05:55:27 +0000
committerdlg <dlg@openbsd.org>2019-04-27 05:55:27 +0000
commit41ce4024d9e76999606ce46d6909a7762eaa6f88 (patch)
treecb5d39f03ac8600395d2e0b896145c3a2e96e7fd
parentuse unsigned int, not u_int, and uintXX_t, not u_intXX_t (diff)
downloadwireguard-openbsd-41ce4024d9e76999606ce46d6909a7762eaa6f88.tar.xz
wireguard-openbsd-41ce4024d9e76999606ce46d6909a7762eaa6f88.zip
don't increment noproto on the parent interface when there's no child
it's not atomic is the main reason. this simplifies leaving the function too.
-rw-r--r--sys/net/if_vlan.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index a5320db3526..c81bce4c6a2 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.196 2019/04/27 05:37:24 dlg Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.197 2019/04/27 05:55:27 dlg Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
@@ -413,15 +413,11 @@ vlan_input(struct ifnet *ifp0, struct mbuf *m, void *cookie)
break;
}
- if (sc == NULL) {
- ifp0->if_noproto++;
- goto drop;
+ if (sc == NULL || !ISSET(sc->sc_if.if_flags, IFF_RUNNING)) {
+ m_freem(m);
+ goto leave;
}
- if ((sc->sc_if.if_flags & (IFF_UP|IFF_RUNNING)) !=
- (IFF_UP|IFF_RUNNING))
- goto drop;
-
/*
* Having found a valid vlan interface corresponding to
* the given source interface and vlan tag, remove the
@@ -450,13 +446,9 @@ vlan_input(struct ifnet *ifp0, struct mbuf *m, void *cookie)
}
if_vinput(&sc->sc_if, m);
+leave:
SRPL_LEAVE(&sr);
return (1);
-
-drop:
- SRPL_LEAVE(&sr);
- m_freem(m);
- return (1);
}
int