summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2015-07-18 00:25:06 +0000
committerclaudio <claudio@openbsd.org>2015-07-18 00:25:06 +0000
commit61fc5e7456542087ad3d486708abae7f4dded920 (patch)
tree9b7f4c8b4f767588d48a7f9140d83d6a457e1a82
parentCheck for errors in the status register after performing a PCI configuration (diff)
downloadwireguard-openbsd-61fc5e7456542087ad3d486708abae7f4dded920.tar.xz
wireguard-openbsd-61fc5e7456542087ad3d486708abae7f4dded920.zip
Packets that make it to ether_input that have M_VLANTAG set must be dropped.
vlan(4) clears M_VLANTAG when a tag matches but if the tag is still there it means that the vlan is not configured on the interface. Found with mpi@ and rzalamena@ while discussing various vlan troubles.
-rw-r--r--sys/net/if_ethersubr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index a4c051cc802..c86a6314c79 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.218 2015/07/17 21:58:07 rzalamena Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.219 2015/07/18 00:25:06 claudio Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -326,8 +326,10 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
/*
* If packet has been filtered by the bpf listener, drop it now
+ * also HW vlan tagged packets that were not collected by vlan(4)
+ * must be dropped now.
*/
- if (m->m_flags & M_FILDROP) {
+ if (m->m_flags & (M_FILDROP | M_VLANTAG)) {
m_freem(m);
return (1);
}