svn commit: r263096 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Wed Mar 12 17:18:16 UTC 2014


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 at 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
 		}


More information about the svn-src-head mailing list