aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--Documentation/networking/ip-sysctl.txt8
-rw-r--r--include/net/netns/sctp.h3
-rw-r--r--include/net/sctp/structs.h5
-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
7 files changed, 11 insertions, 29 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 1b27b0b8687f..36be26b2ef7a 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1507,14 +1507,6 @@ sack_timeout - INTEGER
1507 1507
1508 Default: 200 1508 Default: 200
1509 1509
1510checksum_disable - BOOLEAN
1511 Disable SCTP checksum computing and verification for debugging purpose.
1512
1513 1: Disable checksumming
1514 0: Enable checksumming
1515
1516 Default: 0
1517
1518valid_cookie_life - INTEGER 1510valid_cookie_life - INTEGER
1519 The default lifetime of the SCTP cookie (in milliseconds). The cookie 1511 The default lifetime of the SCTP cookie (in milliseconds). The cookie
1520 is used during association establishment. 1512 is used during association establishment.
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h
index ebfdf1e7d402..3573a81815ad 100644
--- a/include/net/netns/sctp.h
+++ b/include/net/netns/sctp.h
@@ -129,9 +129,6 @@ struct netns_sctp {
129 129
130 /* Threshold for autoclose timeout, in seconds. */ 130 /* Threshold for autoclose timeout, in seconds. */
131 unsigned long max_autoclose; 131 unsigned long max_autoclose;
132
133 /* Flag to disable SCTP checksumming. */
134 int checksum_disable;
135}; 132};
136 133
137#endif /* __NETNS_SCTP_H__ */ 134#endif /* __NETNS_SCTP_H__ */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 78eedf0cd4b3..422db6cc3214 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -135,6 +135,10 @@ extern struct sctp_globals {
135 /* This is the sctp port control hash. */ 135 /* This is the sctp port control hash. */
136 int port_hashsize; 136 int port_hashsize;
137 struct sctp_bind_hashbucket *port_hashtable; 137 struct sctp_bind_hashbucket *port_hashtable;
138
139 /* Flag to indicate whether computing and verifying checksum
140 * is disabled. */
141 bool checksum_disable;
138} sctp_globals; 142} sctp_globals;
139 143
140#define sctp_max_instreams (sctp_globals.max_instreams) 144#define sctp_max_instreams (sctp_globals.max_instreams)
@@ -146,6 +150,7 @@ extern struct sctp_globals {
146#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) 150#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable)
147#define sctp_port_hashsize (sctp_globals.port_hashsize) 151#define sctp_port_hashsize (sctp_globals.port_hashsize)
148#define sctp_port_hashtable (sctp_globals.port_hashtable) 152#define sctp_port_hashtable (sctp_globals.port_hashtable)
153#define sctp_checksum_disable (sctp_globals.checksum_disable)
149 154
150/* SCTP Socket type: UDP or TCP style. */ 155/* SCTP Socket type: UDP or TCP style. */
151typedef enum { 156typedef enum {
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