aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r--net/sctp/output.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c
index bcc4590ccaf2..08b3cead6503 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -41,6 +41,8 @@
41 * be incorporated into the next SCTP release. 41 * be incorporated into the next SCTP release.
42 */ 42 */
43 43
44#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
45
44#include <linux/types.h> 46#include <linux/types.h>
45#include <linux/kernel.h> 47#include <linux/kernel.h>
46#include <linux/wait.h> 48#include <linux/wait.h>
@@ -498,23 +500,20 @@ int sctp_packet_transmit(struct sctp_packet *packet)
498 * Note: Adler-32 is no longer applicable, as has been replaced 500 * Note: Adler-32 is no longer applicable, as has been replaced
499 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
500 */ 502 */
501 if (!sctp_checksum_disable && 503 if (!sctp_checksum_disable) {
502 !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) { 504 if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
503 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 505 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
504 506
505 /* 3) Put the resultant value into the checksum field in the 507 /* 3) Put the resultant value into the checksum field in the
506 * common header, and leave the rest of the bits unchanged. 508 * common header, and leave the rest of the bits unchanged.
507 */ 509 */
508 sh->checksum = sctp_end_cksum(crc32); 510 sh->checksum = sctp_end_cksum(crc32);
509 } else { 511 } else {
510 if (dst->dev->features & NETIF_F_SCTP_CSUM) { 512 /* no need to seed pseudo checksum for SCTP */
511 /* no need to seed psuedo checksum for SCTP */
512 nskb->ip_summed = CHECKSUM_PARTIAL; 513 nskb->ip_summed = CHECKSUM_PARTIAL;
513 nskb->csum_start = (skb_transport_header(nskb) - 514 nskb->csum_start = (skb_transport_header(nskb) -
514 nskb->head); 515 nskb->head);
515 nskb->csum_offset = offsetof(struct sctphdr, checksum); 516 nskb->csum_offset = offsetof(struct sctphdr, checksum);
516 } else {
517 nskb->ip_summed = CHECKSUM_UNNECESSARY;
518 } 517 }
519 } 518 }
520 519