diff options
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r-- | net/sctp/output.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c index 73639355157e..7d08f522ec84 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -49,13 +49,10 @@ | |||
49 | #include <linux/ipv6.h> | 49 | #include <linux/ipv6.h> |
50 | #include <linux/init.h> | 50 | #include <linux/init.h> |
51 | #include <net/inet_ecn.h> | 51 | #include <net/inet_ecn.h> |
52 | #include <net/ip.h> | ||
52 | #include <net/icmp.h> | 53 | #include <net/icmp.h> |
53 | #include <net/net_namespace.h> | 54 | #include <net/net_namespace.h> |
54 | 55 | ||
55 | #ifndef TEST_FRAME | ||
56 | #include <net/tcp.h> | ||
57 | #endif /* TEST_FRAME (not defined) */ | ||
58 | |||
59 | #include <linux/socket.h> /* for sa_family_t */ | 56 | #include <linux/socket.h> /* for sa_family_t */ |
60 | #include <net/sock.h> | 57 | #include <net/sock.h> |
61 | 58 | ||
@@ -367,7 +364,6 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
367 | struct sctp_transport *tp = packet->transport; | 364 | struct sctp_transport *tp = packet->transport; |
368 | struct sctp_association *asoc = tp->asoc; | 365 | struct sctp_association *asoc = tp->asoc; |
369 | struct sctphdr *sh; | 366 | struct sctphdr *sh; |
370 | __be32 crc32 = __constant_cpu_to_be32(0); | ||
371 | struct sk_buff *nskb; | 367 | struct sk_buff *nskb; |
372 | struct sctp_chunk *chunk, *tmp; | 368 | struct sctp_chunk *chunk, *tmp; |
373 | struct sock *sk; | 369 | struct sock *sk; |
@@ -531,17 +527,16 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
531 | * Note: Adler-32 is no longer applicable, as has been replaced | 527 | * Note: Adler-32 is no longer applicable, as has been replaced |
532 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. | 528 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. |
533 | */ | 529 | */ |
534 | if (!(dst->dev->features & NETIF_F_NO_CSUM)) { | 530 | if (!sctp_checksum_disable && !(dst->dev->features & NETIF_F_NO_CSUM)) { |
535 | crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); | 531 | __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); |
536 | crc32 = sctp_end_cksum(crc32); | 532 | |
533 | /* 3) Put the resultant value into the checksum field in the | ||
534 | * common header, and leave the rest of the bits unchanged. | ||
535 | */ | ||
536 | sh->checksum = sctp_end_cksum(crc32); | ||
537 | } else | 537 | } else |
538 | nskb->ip_summed = CHECKSUM_UNNECESSARY; | 538 | nskb->ip_summed = CHECKSUM_UNNECESSARY; |
539 | 539 | ||
540 | /* 3) Put the resultant value into the checksum field in the | ||
541 | * common header, and leave the rest of the bits unchanged. | ||
542 | */ | ||
543 | sh->checksum = crc32; | ||
544 | |||
545 | /* IP layer ECN support | 540 | /* IP layer ECN support |
546 | * From RFC 2481 | 541 | * From RFC 2481 |
547 | * "The ECN-Capable Transport (ECT) bit would be set by the | 542 | * "The ECN-Capable Transport (ECT) bit would be set by the |