aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-08-09 16:09:41 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-09 16:09:41 -0400
commit71acc0ddd499cc323199fb1ae350ce9ea0744352 (patch)
tree496bb919783bb8a89302774be8c1f7a798b364ec /net/sctp
parent477143e3fece3dc12629bb1ebd7b47e8e6e72b2b (diff)
Revert "net: sctp: convert sctp_checksum_disable module param into sctp sysctl"
This reverts commit cda5f98e36576596b9230483ec52bff3cc97eb21. As per Vlad's request. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/input.c4
-rw-r--r--net/sctp/output.c5
-rw-r--r--net/sctp/protocol.c5
-rw-r--r--net/sctp/sysctl.c10
4 files changed, 6 insertions, 18 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 2873e221e187..5f2068679f83 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -134,8 +134,8 @@ int sctp_rcv(struct sk_buff *skb)
134 __skb_pull(skb, skb_transport_offset(skb)); 134 __skb_pull(skb, skb_transport_offset(skb));
135 if (skb->len < sizeof(struct sctphdr)) 135 if (skb->len < sizeof(struct sctphdr))
136 goto discard_it; 136 goto discard_it;
137 if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) && 137 if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
138 sctp_rcv_checksum(net, skb) < 0) 138 sctp_rcv_checksum(net, skb) < 0)
139 goto discard_it; 139 goto discard_it;
140 140
141 skb_pull(skb, sizeof(struct sctphdr)); 141 skb_pull(skb, sizeof(struct sctphdr));
diff --git a/net/sctp/output.c b/net/sctp/output.c
index e35b84cc1d9f..0ac3a65daccb 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -389,7 +389,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
389 int padding; /* How much padding do we need? */ 389 int padding; /* How much padding do we need? */
390 __u8 has_data = 0; 390 __u8 has_data = 0;
391 struct dst_entry *dst = tp->dst; 391 struct dst_entry *dst = tp->dst;
392 struct net *net;
393 unsigned char *auth = NULL; /* pointer to auth in skb data */ 392 unsigned char *auth = NULL; /* pointer to auth in skb data */
394 __u32 cksum_buf_len = sizeof(struct sctphdr); 393 __u32 cksum_buf_len = sizeof(struct sctphdr);
395 394
@@ -536,9 +535,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
536 * Note: Adler-32 is no longer applicable, as has been replaced 535 * Note: Adler-32 is no longer applicable, as has been replaced
537 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 536 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
538 */ 537 */
539 net = dev_net(dst->dev); 538 if (!sctp_checksum_disable) {
540
541 if (!net->sctp.checksum_disable) {
542 if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) { 539 if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
543 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 540 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
544 541
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 54482977a48f..5e17092f4ada 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1187,9 +1187,6 @@ static int __net_init sctp_net_init(struct net *net)
1187 /* Whether Cookie Preservative is enabled(1) or not(0) */ 1187 /* Whether Cookie Preservative is enabled(1) or not(0) */
1188 net->sctp.cookie_preserve_enable = 1; 1188 net->sctp.cookie_preserve_enable = 1;
1189 1189
1190 /* Whether SCTP checksumming is disabled(1) or not(0) */
1191 net->sctp.checksum_disable = 0;
1192
1193 /* Default sctp sockets to use md5 as their hmac alg */ 1190 /* Default sctp sockets to use md5 as their hmac alg */
1194#if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5) 1191#if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
1195 net->sctp.sctp_hmac_alg = "md5"; 1192 net->sctp.sctp_hmac_alg = "md5";
@@ -1546,4 +1543,6 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
1546MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132"); 1543MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
1547MODULE_AUTHOR("Linux Kernel SCTP developers <linux-sctp@vger.kernel.org>"); 1544MODULE_AUTHOR("Linux Kernel SCTP developers <linux-sctp@vger.kernel.org>");
1548MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)"); 1545MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)");
1546module_param_named(no_checksums, sctp_checksum_disable, bool, 0644);
1547MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification");
1549MODULE_LICENSE("GPL"); 1548MODULE_LICENSE("GPL");
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 1b1ee769b5bf..6b36561a1b3b 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -290,15 +290,7 @@ static struct ctl_table sctp_net_table[] = {
290 .extra1 = &max_autoclose_min, 290 .extra1 = &max_autoclose_min,
291 .extra2 = &max_autoclose_max, 291 .extra2 = &max_autoclose_max,
292 }, 292 },
293 { 293
294 .procname = "checksum_disable",
295 .data = &init_net.sctp.checksum_disable,
296 .maxlen = sizeof(int),
297 .mode = 0644,
298 .proc_handler = proc_dointvec_minmax,
299 .extra1 = &zero,
300 .extra2 = &one,
301 },
302 { /* sentinel */ } 294 { /* sentinel */ }
303}; 295};
304 296