From 31c15e372f509c73182796ce60091c972f054b51 Mon Sep 17 00:00:00 2001 From: Lucas Nussbaum Date: Fri, 13 Feb 2009 08:33:41 +0000 Subject: [PATCH] --- yaml --- r: 134579 b: refs/heads/master c: 06e868066e3b5828383eb40ff4d1c0029100b0b5 h: refs/heads/master i: 134577: a42d5d085e76969fc898c01b61b5427564e3e75f 134575: 48d757b27d36b1146fb9fe5eacc538e78137d70e v: v3 --- [refs] | 2 +- trunk/include/net/sctp/structs.h | 5 +++++ trunk/net/sctp/input.c | 3 ++- trunk/net/sctp/output.c | 2 +- trunk/net/sctp/protocol.c | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 3d9bd2959f6f..894b5cc54d60 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 85e8d004ecbc51ead6ae926e15973b42cf07b36e +refs/heads/master: 06e868066e3b5828383eb40ff4d1c0029100b0b5 diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index 9661d7b765f0..9f70d54fcefc 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -218,6 +218,10 @@ extern struct sctp_globals { /* Flag to idicate if SCTP-AUTH is enabled */ int auth_enable; + + /* Flag to indicate whether computing and verifying checksum + * is disabled. */ + int checksum_disable; } sctp_globals; #define sctp_rto_initial (sctp_globals.rto_initial) @@ -252,6 +256,7 @@ extern struct sctp_globals { #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) #define sctp_prsctp_enable (sctp_globals.prsctp_enable) #define sctp_auth_enable (sctp_globals.auth_enable) +#define sctp_checksum_disable (sctp_globals.checksum_disable) /* SCTP Socket type: UDP or TCP style. */ typedef enum { diff --git a/trunk/net/sctp/input.c b/trunk/net/sctp/input.c index 2e4a8646dbc3..693fd0804810 100644 --- a/trunk/net/sctp/input.c +++ b/trunk/net/sctp/input.c @@ -142,7 +142,8 @@ int sctp_rcv(struct sk_buff *skb) __skb_pull(skb, skb_transport_offset(skb)); if (skb->len < sizeof(struct sctphdr)) goto discard_it; - if (!skb_csum_unnecessary(skb) && sctp_rcv_checksum(skb) < 0) + if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) && + sctp_rcv_checksum(skb) < 0) goto discard_it; skb_pull(skb, sizeof(struct sctphdr)); diff --git a/trunk/net/sctp/output.c b/trunk/net/sctp/output.c index 47bfba6c03ec..2d65b7a7330b 100644 --- a/trunk/net/sctp/output.c +++ b/trunk/net/sctp/output.c @@ -531,7 +531,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) * Note: Adler-32 is no longer applicable, as has been replaced * by CRC32-C as described in . */ - if (!(dst->dev->features & NETIF_F_NO_CSUM)) { + if (!sctp_checksum_disable && !(dst->dev->features & NETIF_F_NO_CSUM)) { crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); crc32 = sctp_end_cksum(crc32); } else diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index b78e3be69013..cc0b592698f9 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -1411,4 +1411,6 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132"); MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132"); MODULE_AUTHOR("Linux Kernel SCTP developers "); MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)"); +module_param_named(no_checksums, sctp_checksum_disable, bool, 0644); +MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification"); MODULE_LICENSE("GPL");