Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2014 17:18:15 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263096 - head/sys/netinet
Message-ID:  <201403121718.s2CHIGoa007840@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed Mar 12 17:18:15 2014
New Revision: 263096
URL: http://svnweb.freebsd.org/changeset/base/263096

Log:
  Put the offset of the CRC32C in csum_data instead of 0.
  The virtio driver needs the offset to be stored in csum_data,
  like in the case for UDP and TCP.
  
  The virtio problem was reported by
  Niu Zhixiong <kaiaixi@gmail.com>, who helped in debugging
  and testing the patch.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Wed Mar 12 16:38:55 2014	(r263095)
+++ head/sys/netinet/sctp_output.c	Wed Mar 12 17:18:15 2014	(r263096)
@@ -4108,7 +4108,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 				SCTP_STAT_INCR(sctps_sendnocrc);
 #else
 				m->m_pkthdr.csum_flags = CSUM_SCTP;
-				m->m_pkthdr.csum_data = 0;
+				m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
 				SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
 			}
@@ -4457,7 +4457,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 				SCTP_STAT_INCR(sctps_sendnocrc);
 #else
 				m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
-				m->m_pkthdr.csum_data = 0;
+				m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
 				SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
 			}
@@ -11007,7 +11007,7 @@ sctp_send_resp_msg(struct sockaddr *src,
 			SCTP_STAT_INCR(sctps_sendnocrc);
 #else
 			mout->m_pkthdr.csum_flags = CSUM_SCTP;
-			mout->m_pkthdr.csum_data = 0;
+			mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
 			SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
 		}
@@ -11037,7 +11037,7 @@ sctp_send_resp_msg(struct sockaddr *src,
 			SCTP_STAT_INCR(sctps_sendnocrc);
 #else
 			mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
-			mout->m_pkthdr.csum_data = 0;
+			mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
 			SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403121718.s2CHIGoa007840>