summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-05-21 10:05:04 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-05-21 10:05:04 +0000
commit8cd4467f13f498d5013a68a7b53a7bdf3f6524ad (patch)
tree365984132580c73053e25cf17455aa851a4af2f2
parent1342f949001fc88c4b8e4bea8eb003fa421a8c4b (diff)
fix bnx vlan tagging in the rx path; do not attach the vlan tag twice
if the firmware has been told to keep it and copy the tag in network byte order in the other case. ok mcbride@ dlg@
-rw-r--r--sys/dev/pci/if_bnx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index b25c7864d09..7df8a0b5884 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnx.c,v 1.48 2007/03/05 11:13:09 reyk Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.49 2007/05/21 10:05:03 reyk Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -3942,7 +3942,8 @@ bnx_rx_intr(struct bnx_softc *sc)
* If we received a packet with a vlan tag,
* attach that information to the packet.
*/
- if (status & L2_FHDR_STATUS_L2_VLAN_TAG) {
+ if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) &&
+ !(sc->rx_mode & BNX_EMAC_RX_MODE_KEEP_VLAN_TAG)) {
#if NVLAN > 0
struct ether_vlan_header vh;
@@ -3957,7 +3958,7 @@ bnx_rx_intr(struct bnx_softc *sc)
}
m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&vh);
vh.evl_proto = vh.evl_encap_proto;
- vh.evl_tag = l2fhdr->l2_fhdr_vlan_tag;
+ vh.evl_tag = htons(l2fhdr->l2_fhdr_vlan_tag);
vh.evl_encap_proto = htons(ETHERTYPE_VLAN);
m_adj(m, ETHER_HDR_LEN);
M_PREPEND(m, sizeof(vh), M_DONTWAIT);