diff options
-rw-r--r-- | include/net/sctp/structs.h | 5 | ||||
-rw-r--r-- | net/sctp/input.c | 3 | ||||
-rw-r--r-- | net/sctp/output.c | 2 | ||||
-rw-r--r-- | net/sctp/protocol.c | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 9661d7b765f0..9f70d54fcefc 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -218,6 +218,10 @@ extern struct sctp_globals { | |||
218 | 218 | ||
219 | /* Flag to idicate if SCTP-AUTH is enabled */ | 219 | /* Flag to idicate if SCTP-AUTH is enabled */ |
220 | int auth_enable; | 220 | int auth_enable; |
221 | |||
222 | /* Flag to indicate whether computing and verifying checksum | ||
223 | * is disabled. */ | ||
224 | int checksum_disable; | ||
221 | } sctp_globals; | 225 | } sctp_globals; |
222 | 226 | ||
223 | #define sctp_rto_initial (sctp_globals.rto_initial) | 227 | #define sctp_rto_initial (sctp_globals.rto_initial) |
@@ -252,6 +256,7 @@ extern struct sctp_globals { | |||
252 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) | 256 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) |
253 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 257 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
254 | #define sctp_auth_enable (sctp_globals.auth_enable) | 258 | #define sctp_auth_enable (sctp_globals.auth_enable) |
259 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | ||
255 | 260 | ||
256 | /* SCTP Socket type: UDP or TCP style. */ | 261 | /* SCTP Socket type: UDP or TCP style. */ |
257 | typedef enum { | 262 | typedef enum { |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 2e4a8646dbc3..693fd0804810 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -142,7 +142,8 @@ int sctp_rcv(struct sk_buff *skb) | |||
142 | __skb_pull(skb, skb_transport_offset(skb)); | 142 | __skb_pull(skb, skb_transport_offset(skb)); |
143 | if (skb->len < sizeof(struct sctphdr)) | 143 | if (skb->len < sizeof(struct sctphdr)) |
144 | goto discard_it; | 144 | goto discard_it; |
145 | if (!skb_csum_unnecessary(skb) && sctp_rcv_checksum(skb) < 0) | 145 | if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) && |
146 | sctp_rcv_checksum(skb) < 0) | ||
146 | goto discard_it; | 147 | goto discard_it; |
147 | 148 | ||
148 | skb_pull(skb, sizeof(struct sctphdr)); | 149 | skb_pull(skb, sizeof(struct sctphdr)); |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 47bfba6c03ec..2d65b7a7330b 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -531,7 +531,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
531 | * Note: Adler-32 is no longer applicable, as has been replaced | 531 | * Note: Adler-32 is no longer applicable, as has been replaced |
532 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. | 532 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. |
533 | */ | 533 | */ |
534 | if (!(dst->dev->features & NETIF_F_NO_CSUM)) { | 534 | if (!sctp_checksum_disable && !(dst->dev->features & NETIF_F_NO_CSUM)) { |
535 | crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); | 535 | crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); |
536 | crc32 = sctp_end_cksum(crc32); | 536 | crc32 = sctp_end_cksum(crc32); |
537 | } else | 537 | } else |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index b78e3be69013..cc0b592698f9 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -1411,4 +1411,6 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132"); | |||
1411 | MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132"); | 1411 | MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132"); |
1412 | MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge.net>"); | 1412 | MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge.net>"); |
1413 | MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)"); | 1413 | MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)"); |
1414 | module_param_named(no_checksums, sctp_checksum_disable, bool, 0644); | ||
1415 | MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification"); | ||
1414 | MODULE_LICENSE("GPL"); | 1416 | MODULE_LICENSE("GPL"); |