summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-04-27 05:55:28 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-04-27 05:55:28 +0000
commitcbb21e4c3c88174c48993aa262c370bf69df238d (patch)
treeaa24f715d0ef283f2e00629581072118c0a6cfcb /sys/net
parentb9706723066230d5ddd2374e8e73bb9f5ba34261 (diff)
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.
Diffstat (limited to 'sys/net')
-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