summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-03-30 10:24:52 +0000
committerru <ru@FreeBSD.org>2004-03-30 10:24:52 +0000
commita3ec925a30006481fb63746d778710ebead4848b (patch)
treea537aa759f785dbdf690fe0578caa2509269048d
parent1a32baef3b0a59ce98722d27119cc2a43cdf7e02 (diff)
downloadFreeBSD-src-a3ec925a30006481fb63746d778710ebead4848b.zip
FreeBSD-src-a3ec925a30006481fb63746d778710ebead4848b.tar.gz
The VLAN TCI field should be operated in network byte order.
This fixes the VLAN support for nge(4). Reported by: Jacob S. Barrett MFC after: 3 days
-rw-r--r--sys/dev/nge/if_nge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c
index c41424e..2805b1e 100644
--- a/sys/dev/nge/if_nge.c
+++ b/sys/dev/nge/if_nge.c
@@ -1392,7 +1392,7 @@ nge_rxeof(sc)
*/
if (extsts & NGE_RXEXTSTS_VLANPKT) {
VLAN_INPUT_TAG(ifp, m,
- extsts & NGE_RXEXTSTS_VTCI, continue);
+ ntohs(extsts & NGE_RXEXTSTS_VTCI), continue);
}
(*ifp->if_input)(ifp, m);
@@ -1715,7 +1715,7 @@ nge_encap(sc, m_head, txidx)
mtag = VLAN_OUTPUT_TAG(&sc->arpcom.ac_if, m);
if (mtag != NULL) {
sc->nge_ldata->nge_tx_list[cur].nge_extsts |=
- (NGE_TXEXTSTS_VLANPKT|VLAN_TAG_VALUE(mtag));
+ (NGE_TXEXTSTS_VLANPKT|htons(VLAN_TAG_VALUE(mtag)));
}
sc->nge_ldata->nge_tx_list[cur].nge_mbuf = m_head;
OpenPOWER on IntegriCloud