summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2015-02-16 18:24:03 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2015-02-16 18:24:03 +0000
commitdbc3197b6c1271eeb8f6f686262c25b1f9a04a04 (patch)
treeb3f49d4de8d2497c42178f6fc948533f633f7ed9 /sys
parentcebfaa01c85d6e9029789b1e3d4dfd2eac9c3a7d (diff)
avoid double vlan-header or vlan-header for non-vlan(4) interfaces
(will panic) in bridge context; ok henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_ethersubr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 05e07b061df..b6358fd4699 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.188 2015/02/09 00:21:58 dlg Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.189 2015/02/16 18:24:02 markus Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -202,6 +202,16 @@ ether_addheader(struct mbuf **m, struct ifnet *ifp, u_int16_t etype,
if (prio <= 1)
prio = !prio;
+#if NBRIDGE > 0
+ /*
+ * The bridge might send on non-vlan interfaces -- which
+ * do not need this header -- or add the vlan-header itself
+ * in bridge_ifenqueue -- which would add a second header.
+ */
+ if (ifp->if_bridgeport)
+ (*m)->m_flags &= ~M_VLANTAG;
+ else
+#endif
/* should we use the tx tagging hw offload at all? */
if ((p->if_capabilities & IFCAP_VLAN_HWTAGGING) &&
(ifv->ifv_type == ETHERTYPE_VLAN)) {