svn commit: r216860 - head/sys/dev/msk

Pyun YongHyeon yongari at FreeBSD.org
Fri Dec 31 22:18:41 UTC 2010


Author: yongari
Date: Fri Dec 31 22:18:41 2010
New Revision: 216860
URL: http://svn.freebsd.org/changeset/base/216860

Log:
  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 )

Modified:
  head/sys/dev/msk/if_msk.c

Modified: head/sys/dev/msk/if_msk.c
==============================================================================
--- head/sys/dev/msk/if_msk.c	Fri Dec 31 21:57:54 2010	(r216859)
+++ head/sys/dev/msk/if_msk.c	Fri Dec 31 22:18:41 2010	(r216860)
@@ -3070,7 +3070,7 @@ msk_rxcsum(struct msk_if_softc *sc_if, u
 	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) {


More information about the svn-src-head mailing list