Skip to content

Commit 71acc0d

Browse files
committed
Revert "net: sctp: convert sctp_checksum_disable module param into sctp sysctl"
This reverts commit cda5f98. As per Vlad's request. Signed-off-by: David S. Miller <[email protected]>
1 parent 477143e commit 71acc0d

File tree

7 files changed

+11
-29
lines changed

7 files changed

+11
-29
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,14 +1507,6 @@ sack_timeout - INTEGER
15071507

15081508
Default: 200
15091509

1510-
checksum_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-
15181510
valid_cookie_life - INTEGER
15191511
The default lifetime of the SCTP cookie (in milliseconds). The cookie
15201512
is used during association establishment.

include/net/netns/sctp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ struct netns_sctp {
129129

130130
/* Threshold for autoclose timeout, in seconds. */
131131
unsigned long max_autoclose;
132-
133-
/* Flag to disable SCTP checksumming. */
134-
int checksum_disable;
135132
};
136133

137134
#endif /* __NETNS_SCTP_H__ */

include/net/sctp/structs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ extern struct sctp_globals {
135135
/* This is the sctp port control hash. */
136136
int port_hashsize;
137137
struct sctp_bind_hashbucket *port_hashtable;
138+
139+
/* Flag to indicate whether computing and verifying checksum
140+
* is disabled. */
141+
bool checksum_disable;
138142
} sctp_globals;
139143

140144
#define sctp_max_instreams (sctp_globals.max_instreams)
@@ -146,6 +150,7 @@ extern struct sctp_globals {
146150
#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable)
147151
#define sctp_port_hashsize (sctp_globals.port_hashsize)
148152
#define sctp_port_hashtable (sctp_globals.port_hashtable)
153+
#define sctp_checksum_disable (sctp_globals.checksum_disable)
149154

150155
/* SCTP Socket type: UDP or TCP style. */
151156
typedef enum {

net/sctp/input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ int sctp_rcv(struct sk_buff *skb)
134134
__skb_pull(skb, skb_transport_offset(skb));
135135
if (skb->len < sizeof(struct sctphdr))
136136
goto discard_it;
137-
if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) &&
138-
sctp_rcv_checksum(net, skb) < 0)
137+
if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
138+
sctp_rcv_checksum(net, skb) < 0)
139139
goto discard_it;
140140

141141
skb_pull(skb, sizeof(struct sctphdr));

net/sctp/output.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
389389
int padding; /* How much padding do we need? */
390390
__u8 has_data = 0;
391391
struct dst_entry *dst = tp->dst;
392-
struct net *net;
393392
unsigned char *auth = NULL; /* pointer to auth in skb data */
394393
__u32 cksum_buf_len = sizeof(struct sctphdr);
395394

@@ -536,9 +535,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
536535
* Note: Adler-32 is no longer applicable, as has been replaced
537536
* by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
538537
*/
539-
net = dev_net(dst->dev);
540-
541-
if (!net->sctp.checksum_disable) {
538+
if (!sctp_checksum_disable) {
542539
if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
543540
__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
544541

net/sctp/protocol.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,6 @@ static int __net_init sctp_net_init(struct net *net)
11871187
/* Whether Cookie Preservative is enabled(1) or not(0) */
11881188
net->sctp.cookie_preserve_enable = 1;
11891189

1190-
/* Whether SCTP checksumming is disabled(1) or not(0) */
1191-
net->sctp.checksum_disable = 0;
1192-
11931190
/* Default sctp sockets to use md5 as their hmac alg */
11941191
#if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
11951192
net->sctp.sctp_hmac_alg = "md5";
@@ -1546,4 +1543,6 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
15461543
MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
15471544
MODULE_AUTHOR("Linux Kernel SCTP developers <[email protected]>");
15481545
MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)");
1546+
module_param_named(no_checksums, sctp_checksum_disable, bool, 0644);
1547+
MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification");
15491548
MODULE_LICENSE("GPL");

net/sctp/sysctl.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,7 @@ static struct ctl_table sctp_net_table[] = {
290290
.extra1 = &max_autoclose_min,
291291
.extra2 = &max_autoclose_max,
292292
},
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-
},
293+
302294
{ /* sentinel */ }
303295
};
304296

0 commit comments

Comments
 (0)