From d8c101a994c7298674e73ef9124de9deb3666291 Mon Sep 17 00:00:00 2001 From: tuexen Date: Wed, 14 May 2014 19:00:01 +0000 Subject: [PATCH] MFC r263096: 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 , who helped in debugging and testing the patch. git-svn-id: svn://svn.freebsd.org/base/stable/9@266081 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/sctp_output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 6f9b939e7..911681773 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4108,7 +4108,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, 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_inpcb *inp, 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, struct sockaddr *dst, 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, struct sockaddr *dst, 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 } -- 2.45.0