summaryrefslogtreecommitdiffstats
path: root/sys/dev/msk/if_msk.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-12-31 22:18:41 +0000
committeryongari <yongari@FreeBSD.org>2010-12-31 22:18:41 +0000
commit475bb93831fc7c1d9036f41bb1dc214de2725f4e (patch)
tree794ed0b4dc0f5a0652e04ca70c6913124fe02588 /sys/dev/msk/if_msk.c
parent43c37d3ddd36bdfbdd60c529a228f1c741694657 (diff)
downloadFreeBSD-src-475bb93831fc7c1d9036f41bb1dc214de2725f4e.zip
FreeBSD-src-475bb93831fc7c1d9036f41bb1dc214de2725f4e.tar.gz
Fix endianness bug introduced in r205091.
After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com )
Diffstat (limited to 'sys/dev/msk/if_msk.c')
-rw-r--r--sys/dev/msk/if_msk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index 810ab03..296115a 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -3070,7 +3070,7 @@ msk_rxcsum(struct msk_if_softc *sc_if, uint32_t control, struct mbuf *m)
default:
return;
}
- csum = ntohs(sc_if->msk_csum & 0xFFFF);
+ csum = bswap16(sc_if->msk_csum & 0xFFFF);
/* Checksum fixup for IP options. */
len = hlen - sizeof(struct ip);
if (len > 0) {
OpenPOWER on IntegriCloud