summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-05-27 12:23:44 +0000
committerdlg <dlg@openbsd.org>2015-05-27 12:23:44 +0000
commitc0a68582ec672efb747df40de4e4bf923a689a94 (patch)
tree0004417aedaf8f7ceef672461c9556ad1746f622
parentImprove the controller state check in xhci_reset (diff)
downloadwireguard-openbsd-c0a68582ec672efb747df40de4e4bf923a689a94.tar.xz
wireguard-openbsd-c0a68582ec672efb747df40de4e4bf923a689a94.zip
check if the packet is for us or if we're promisc before we cut the
vlan header out of the packet. fixes rx on top of trunks on top of nics that dont do hw vlan tagging. ok mpi@
-rw-r--r--sys/net/if_vlan.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 76f20fea76c..e3dd261e746 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.126 2015/05/26 11:39:07 mpi Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.127 2015/05/27 12:23:44 dlg Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
@@ -332,19 +332,6 @@ vlan_input(struct mbuf *m)
}
/*
- * Having found a valid vlan interface corresponding to
- * the given source interface and vlan tag, remove the
- * encapsulation.
- */
- if (m->m_flags & M_VLANTAG) {
- m->m_flags &= ~M_VLANTAG;
- } else {
- eh->ether_type = evl->evl_proto;
- memmove((char *)eh + EVL_ENCAPLEN, eh, sizeof(*eh));
- m_adj(m, EVL_ENCAPLEN);
- }
-
- /*
* Drop promiscuously received packets if we are not in
* promiscuous mode.
*/
@@ -358,6 +345,19 @@ vlan_input(struct mbuf *m)
}
}
+ /*
+ * Having found a valid vlan interface corresponding to
+ * the given source interface and vlan tag, remove the
+ * encapsulation.
+ */
+ if (m->m_flags & M_VLANTAG) {
+ m->m_flags &= ~M_VLANTAG;
+ } else {
+ eh->ether_type = evl->evl_proto;
+ memmove((char *)eh + EVL_ENCAPLEN, eh, sizeof(*eh));
+ m_adj(m, EVL_ENCAPLEN);
+ }
+
ml_enqueue(&ml, m);
if_input(&ifv->ifv_if, &ml);
ifv->ifv_if.if_ipackets++;