diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-02-06 22:10:44 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-02-06 22:10:44 +0000 |
commit | 5e1d30b29262f194f8de2d0a9420f372c0e6b796 (patch) | |
tree | a227eebb72e311ba956ffcbb94f255c518563d6c /sys | |
parent | 7acede81880894eef660f46a8e33d419fa4868a1 (diff) |
earlier rev 1.112 sys/net/if_vlan.c corrects the mapping of 802.1p
prio from the vlan header to our pf priority levels. This fixes the
mapping in the bridge code.
ok henning
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_bridge.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 76484158c15..733266dc88f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.231 2014/12/22 03:38:01 tedu Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.232 2015/02/06 22:10:43 benno Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -2692,12 +2692,17 @@ bridge_ifenqueue(struct bridge_softc *sc, struct ifnet *ifp, struct mbuf *m) if (ifp->if_output == vlan_output) { struct ifvlan *ifv = ifp->if_softc; struct ifnet *p = ifv->ifv_p; + u_int8_t prio = m->m_pkthdr.pf.prio; + + /* IEEE 802.1p has prio 0 and 1 swapped */ + if (prio <= 1) + prio = !prio; /* should we use the tx tagging hw offload at all? */ if ((p->if_capabilities & IFCAP_VLAN_HWTAGGING) && (ifv->ifv_type == ETHERTYPE_VLAN)) { m->m_pkthdr.ether_vtag = ifv->ifv_tag + - (m->m_pkthdr.pf.prio << EVL_PRIO_BITS); + (prio << EVL_PRIO_BITS); m->m_flags |= M_VLANTAG; } else { struct ether_vlan_header evh; @@ -2706,7 +2711,7 @@ bridge_ifenqueue(struct bridge_softc *sc, struct ifnet *ifp, struct mbuf *m) evh.evl_proto = evh.evl_encap_proto; evh.evl_encap_proto = htons(ifv->ifv_type); evh.evl_tag = htons(ifv->ifv_tag + - (m->m_pkthdr.pf.prio << EVL_PRIO_BITS)); + (prio << EVL_PRIO_BITS)); m_adj(m, ETHER_HDR_LEN); M_PREPEND(m, sizeof(evh), M_DONTWAIT); if (m == NULL) { |