Skip to contentSkip to conversation

net: sctp: convert sctp_checksum_disable module param into sctp sysctl

PATCH Applied Daniel Borkmann 4 participants 10 messages Aug 6, 2013 – Aug 9, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: sctp: convert sctp_checksum_disable module param into sctp sysctl

Get rid of the last module parameter for SCTP and make this configurable via sysctl for SCTP like all the rest of SCTP's configuration knobs.

---
 Documentation/networking/ip-sysctl.txt |  8 ++++++++
 include/net/netns/sctp.h               |  3 +++
 include/net/sctp/structs.h             |  5 -----
 net/sctp/input.c                       |  4 ++--
 net/sctp/output.c                      |  5 ++++-
 net/sctp/protocol.c                    |  5 +++--
 net/sctp/sysctl.c                      | 10 +++++++++-
 7 files changed, 29 insertions(+), 11 deletions(-)
Documentation/networking/ip-sysctl.txt +8 -0
index 36be26b..6f5b813 100644
@@ -1507,6 +1507,14 @@ sack_timeout - INTEGER
 
 	Default: 200
 
+checksum_disable - BOOLEAN
+	Disable SCTP checksum computing and verification for debugging purpose.
+
+	1: Disable checksumming
+	0: Enable checksumming
+
+	Default: 0
+
 valid_cookie_life - INTEGER
 	The default lifetime of the SCTP cookie (in milliseconds).  The cookie
 	is used during association establishment.
include/net/netns/sctp.h +3 -0
index 3573a81..ebfdf1e 100644
@@ -129,6 +129,9 @@ struct netns_sctp {
 
 	/* Threshold for autoclose timeout, in seconds. */
 	unsigned long max_autoclose;
+
+	/* Flag to disable SCTP checksumming. */
+	int checksum_disable;
 };
 
 #endif /* __NETNS_SCTP_H__ */
include/net/sctp/structs.h +0 -5
index d9c93a7..06ebeaa 100644
@@ -141,10 +141,6 @@ extern struct sctp_globals {
 	/* This is the sctp port control hash.	*/
 	int port_hashsize;
 	struct sctp_bind_hashbucket *port_hashtable;
-
-	/* Flag to indicate whether computing and verifying checksum
-	 * is disabled. */
-        bool checksum_disable;
 } sctp_globals;
 
 #define sctp_max_instreams		(sctp_globals.max_instreams)
@@ -156,7 +152,6 @@ extern struct sctp_globals {
 #define sctp_assoc_hashtable		(sctp_globals.assoc_hashtable)
 #define sctp_port_hashsize		(sctp_globals.port_hashsize)
 #define sctp_port_hashtable		(sctp_globals.port_hashtable)
-#define sctp_checksum_disable		(sctp_globals.checksum_disable)
 
 /* SCTP Socket type: UDP or TCP style. */
 typedef enum {
net/sctp/input.c +2 -2
index fa91aff..b9a25e1 100644
@@ -140,8 +140,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 (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-		  sctp_rcv_checksum(net, skb) < 0)
+	if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) &&
+	    sctp_rcv_checksum(net, skb) < 0)
 		goto discard_it;
 
 	skb_pull(skb, sizeof(struct sctphdr));
net/sctp/output.c +4 -1
index 5a55c55d..cdb5f49 100644
@@ -395,6 +395,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	int padding;		/* How much padding do we need?  */
 	__u8 has_data = 0;
 	struct dst_entry *dst = tp->dst;
+	struct net *net;
 	unsigned char *auth = NULL;	/* pointer to auth in skb data */
 	__u32 cksum_buf_len = sizeof(struct sctphdr);
 
@@ -541,7 +542,9 @@ 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 <draft-ietf-tsvwg-sctpcsum-02.txt>.
 	 */
-	if (!sctp_checksum_disable) {
+	net = dev_net(dst->dev);
+
+	if (!net->sctp.checksum_disable) {
 		if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
 			__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
net/sctp/protocol.c +3 -2
index b52ec25..a570a63 100644
@@ -1193,6 +1193,9 @@ static int __net_init sctp_net_init(struct net *net)
 	/* Whether Cookie Preservative is enabled(1) or not(0) */
 	net->sctp.cookie_preserve_enable 	= 1;
 
+	/* Whether SCTP checksumming is disabled(1) or not(0) */
+	net->sctp.checksum_disable		= 0;
+
 	/* Default sctp sockets to use md5 as their hmac alg */
 #if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
 	net->sctp.sctp_hmac_alg			= "md5";
@@ -1549,6 +1552,4 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
 MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
 MODULE_AUTHOR("Linux Kernel SCTP developers <[email protected]>");
 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");
net/sctp/sysctl.c +9 -1
index 1906747..754809a 100644
@@ -296,7 +296,15 @@ static struct ctl_table sctp_net_table[] = {
 		.extra1		= &max_autoclose_min,
 		.extra2		= &max_autoclose_max,
 	},
-
+	{
+		.procname	= "checksum_disable",
+		.data		= &init_net.sctp.checksum_disable,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &zero,
+		.extra2		= &one,
+	},
 	{ /* sentinel */ }
 };
 
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 2/2 net: sctp: trivial: update bug report in header comment

With the restructuring of the lksctp.org site, we only allow bug reports through the SCTP mailing list [email protected], not via SF, as SF is only used for web hosting and nothing more. While at it, also remove the obvious statement that bugs will be fixed and incooperated into the kernel.

---
 include/net/sctp/auth.h      |  6 ------
 include/net/sctp/checksum.h  |  6 ------
 include/net/sctp/command.h   | 18 ++++++++----------
 include/net/sctp/constants.h |  6 ------
 include/net/sctp/sctp.h      |  6 ------
 include/net/sctp/sm.h        |  6 ------
 include/net/sctp/structs.h   |  6 ------
 include/net/sctp/tsnmap.h    |  6 ------
 include/net/sctp/ulpevent.h  |  6 ------
 include/net/sctp/ulpqueue.h  |  6 ------
 net/sctp/associola.c         |  6 ------
 net/sctp/auth.c              |  6 ------
 net/sctp/bind_addr.c         |  6 ------
 net/sctp/chunk.c             |  6 ------
 net/sctp/command.c           |  6 ------
 net/sctp/debug.c             |  6 ------
 net/sctp/endpointola.c       |  6 ------
 net/sctp/input.c             |  6 ------
 net/sctp/inqueue.c           |  6 ------
 net/sctp/ipv6.c              |  6 ------
 net/sctp/objcnt.c            |  6 ------
 net/sctp/output.c            |  6 ------
 net/sctp/outqueue.c          |  6 ------
 net/sctp/primitive.c         |  6 ------
 net/sctp/proc.c              |  6 ------
 net/sctp/protocol.c          |  6 ------
 net/sctp/sm_make_chunk.c     |  6 ------
 net/sctp/sm_sideeffect.c     |  6 ------
 net/sctp/sm_statefuns.c      |  6 ------
 net/sctp/sm_statetable.c     |  6 ------
 net/sctp/socket.c            |  6 ------
 net/sctp/ssnmap.c            |  6 ------
 net/sctp/sysctl.c            |  6 ------
 net/sctp/transport.c         |  6 ------
 net/sctp/tsnmap.c            |  6 ------
 net/sctp/ulpevent.c          |  6 ------
 net/sctp/ulpqueue.c          |  6 ------
 37 files changed, 8 insertions(+), 226 deletions(-)
include/net/sctp/auth.h +0 -6
index 754c511..aa80bef 100644
@@ -24,14 +24,8 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   Vlad Yasevich     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_auth_h__
include/net/sctp/checksum.h +0 -6
index 483e630..259924d 100644
@@ -27,9 +27,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Dinakaran Joseph
  *    Jon Grimm <[email protected]>
@@ -37,9 +34,6 @@
  *
  * Rewritten to use libcrc32c by:
  *    Vlad Yasevich <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_checksum_h__
include/net/sctp/command.h +8 -10
index 3524727..832f219 100644
@@ -23,19 +23,17 @@
  * the Free Software Foundation, 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  *
- * Please send any bug reports or fixes you make to one of the
- * following email addresses:
+ * Please send any bug reports or fixes you make to the
+ * email address(es):
+ *    lksctp developers <[email protected]>
  *
- * La Monte H.P. Yarroll <[email protected]>
- * Karl Knutson <[email protected]>
- * Ardelle Fan <[email protected]>
- * Sridhar Samudrala <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
+ * Written or modified by:
+ *   La Monte H.P. Yarroll <[email protected]>
+ *   Karl Knutson <[email protected]>
+ *   Ardelle Fan <[email protected]>
+ *   Sridhar Samudrala <[email protected]>
  */
 
-
 #ifndef __net_sctp_command_h__
 #define __net_sctp_command_h__
 
include/net/sctp/constants.h +0 -6
index a1e7aa5..2f0a565 100644
@@ -27,9 +27,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   La Monte H.P. Yarroll <[email protected]>
  *   Karl Knutson          <[email protected]>
@@ -39,9 +36,6 @@
  *   Xingang Guo           <[email protected]>
  *   Sridhar Samudrala     <[email protected]>
  *   Daisy Chang           <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_constants_h__
include/net/sctp/sctp.h +0 -6
index cb28df9..3794c5a 100644
@@ -29,9 +29,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Xingang Guo           <[email protected]>
@@ -41,9 +38,6 @@
  *    Ardelle Fan           <[email protected]>
  *    Ryan Layer            <[email protected]>
  *    Kevin Gao             <[email protected]> 
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __net_sctp_h__
include/net/sctp/sm.h +0 -6
index 2aa66dd..4ef75af 100644
@@ -29,9 +29,6 @@
  * email addresses:
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
@@ -42,9 +39,6 @@
  *    Daisy Chang <[email protected]>
  *    Ardelle Fan <[email protected]>
  *    Kevin Gao <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
include/net/sctp/structs.h +0 -6
index 06ebeaa..78eedf0 100644
@@ -27,9 +27,6 @@
  * email addresses:
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Randall Stewart	    <[email protected]>
  *    Ken Morneau	    <[email protected]>
@@ -46,9 +43,6 @@
  *    Ryan Layer	    <[email protected]>
  *    Anup Pemmaiah	    <[email protected]>
  *    Kevin Gao             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_structs_h__
include/net/sctp/tsnmap.h +0 -6
index c361d6f..54bbbe5 100644
@@ -30,17 +30,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   Jon Grimm             <[email protected]>
  *   La Monte H.P. Yarroll <[email protected]>
  *   Karl Knutson          <[email protected]>
  *   Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 #include <net/sctp/constants.h>
 
include/net/sctp/ulpevent.h +0 -6
index 34f0d34..27b9f5c 100644
@@ -33,17 +33,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   Jon Grimm             <[email protected]>
  *   La Monte H.P. Yarroll <[email protected]>
  *   Karl Knutson          <[email protected]>
  *   Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_ulpevent_h__
include/net/sctp/ulpqueue.h +0 -6
index add3237..b0cf5d5 100644
@@ -32,16 +32,10 @@
  * email addresses:
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   Jon Grimm             <[email protected]>
  *   La Monte H.P. Yarroll <[email protected]>
  *   Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #ifndef __sctp_ulpqueue_h__
net/sctp/associola.c +0 -6
index e425ba0..e051920 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -43,9 +40,6 @@
  *    Daisy Chang	    <[email protected]>
  *    Ryan Layer	    <[email protected]>
  *    Kevin Gao             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/auth.c +0 -6
index 3aab967..8c4fa5d 100644
@@ -24,14 +24,8 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *   Vlad Yasevich     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/slab.h>
net/sctp/bind_addr.c +0 -6
index f34ce8b..077bb07 100644
@@ -29,17 +29,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
  *    Jon Grimm             <[email protected]>
  *    Daisy Chang           <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/chunk.c +0 -6
index b50b90c..bd0bdd0 100644
@@ -26,15 +26,9 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Jon Grimm             <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/command.c +0 -6
index f4bebda..3d9a9ff 100644
@@ -27,15 +27,9 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/debug.c +0 -6
index 44aa4e7..e89015d 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -40,9 +37,6 @@
  *    Jon Grimm             <[email protected]>
  *    Daisy Chang	    <[email protected]>
  *    Sridhar Samudrala	    <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <net/sctp/sctp.h>
net/sctp/endpointola.c +0 -6
index 825b754..09b8daa 100644
@@ -31,18 +31,12 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
  *    Jon Grimm <[email protected]>
  *    Daisy Chang <[email protected]>
  *    Dajiang Zhang <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/input.c +0 -6
index b9a25e1..2873e22 100644
@@ -31,9 +31,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
@@ -43,9 +40,6 @@
  *    Daisy Chang <[email protected]>
  *    Sridhar Samudrala <[email protected]>
  *    Ardelle Fan <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/inqueue.c +0 -6
index e70f60a..5856932 100644
@@ -32,15 +32,9 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/ipv6.c +0 -6
index 5a9402e..da613ce 100644
@@ -29,9 +29,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Le Yanqun		    <[email protected]>
  *    Hui Huang		    <[email protected]>
@@ -42,9 +39,6 @@
  *
  * Based on:
  *	linux/net/ipv6/tcp_ipv6.c
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/objcnt.c +0 -6
index aec346c..5ea573b 100644
@@ -28,14 +28,8 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Jon Grimm             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/output.c +0 -6
index cdb5f49..e35b84c 100644
@@ -28,17 +28,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
  *    Jon Grimm             <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/outqueue.c +0 -6
index 5131323..94df758 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -41,9 +38,6 @@
  *    Hui Huang 	    <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
  *    Jon Grimm             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/primitive.c +0 -6
index 31fa437..ce1ffd8 100644
@@ -31,18 +31,12 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Narasimha Budihal     <[email protected]>
  *    Karl Knutson          <[email protected]>
  *    Ardelle Fan	    <[email protected]>
  *    Kevin Gao             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/proc.c +0 -6
index aff0cac..82432bf 100644
@@ -24,14 +24,8 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Sridhar Samudrala <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/protocol.c +0 -6
index a570a63..5448297 100644
@@ -31,9 +31,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson <[email protected]>
@@ -41,9 +38,6 @@
  *    Sridhar Samudrala <[email protected]>
  *    Daisy Chang <[email protected]>
  *    Ardelle Fan <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/sm_make_chunk.c +0 -6
index 780a2d4..9c13133 100644
@@ -31,9 +31,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -45,9 +42,6 @@
  *    Daisy Chang	    <[email protected]>
  *    Ardelle Fan	    <[email protected]>
  *    Kevin Gao             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/sm_sideeffect.c +0 -6
index f1f3aac..666c668 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -42,9 +39,6 @@
  *    Daisy Chang	    <[email protected]>
  *    Sridhar Samudrala	    <[email protected]>
  *    Ardelle Fan	    <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/sm_statefuns.c +0 -6
index 93271f0..dfe3f36 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -45,9 +42,6 @@
  *    Ardelle Fan	    <[email protected]>
  *    Ryan Layer	    <[email protected]>
  *    Kevin Gao		    <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/sm_statetable.c +0 -6
index 64ea5fd..c5999b2 100644
@@ -30,9 +30,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -41,9 +38,6 @@
  *    Daisy Chang	    <[email protected]>
  *    Ardelle Fan	    <[email protected]>
  *    Sridhar Samudrala	    <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/socket.c +0 -6
index 0245712..d5d5882 100644
@@ -36,9 +36,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Narasimha Budihal     <[email protected]>
@@ -52,9 +49,6 @@
  *    Ryan Layer	    <[email protected]>
  *    Anup Pemmaiah         <[email protected]>
  *    Kevin Gao             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/ssnmap.c +0 -6
index 72b5939..6007124 100644
@@ -26,14 +26,8 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Jon Grimm             <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/types.h>
net/sctp/sysctl.c +0 -6
index 754809a..1b1ee76 100644
@@ -27,18 +27,12 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Mingqin Liu           <[email protected]>
  *    Jon Grimm             <[email protected]>
  *    Ardelle Fan           <[email protected]>
  *    Ryan Layer            <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <net/sctp/structs.h>
net/sctp/transport.c +0 -6
index 9602c52..6836ead 100644
@@ -32,9 +32,6 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Karl Knutson          <[email protected]>
@@ -43,9 +40,6 @@
  *    Hui Huang             <[email protected]>
  *    Sridhar Samudrala	    <[email protected]>
  *    Ardelle Fan	    <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
net/sctp/tsnmap.c +0 -6
index 0eff866..fbda200 100644
@@ -29,17 +29,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    La Monte H.P. Yarroll <[email protected]>
  *    Jon Grimm             <[email protected]>
  *    Karl Knutson          <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/slab.h>
net/sctp/ulpevent.c +0 -6
index c07624f..81089ed 100644
@@ -30,17 +30,11 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Jon Grimm             <[email protected]>
  *    La Monte H.P. Yarroll <[email protected]>
  *    Ardelle Fan	    <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/slab.h>
net/sctp/ulpqueue.c +0 -6
index 2cdb301..1c1484e 100644
@@ -29,16 +29,10 @@
  * email address(es):
  *    lksctp developers <[email protected]>
  *
- * Or submit a bug report through the following website:
- *    http://www.sf.net/projects/lksctp
- *
  * Written or modified by:
  *    Jon Grimm             <[email protected]>
  *    La Monte H.P. Yarroll <[email protected]>
  *    Sridhar Samudrala     <[email protected]>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
  */
 
 #include <linux/slab.h>
Signature · 1 line
1.7.11.7
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH net-next 2/2] net: sctp: trivial: update bug report in header comment

Quoted 5 lines · Daniel Borkmann

With the restructuring of the lksctp.org site, we only allow bug reports through the SCTP mailing list [email protected], not via SF, as SF is only used for web hosting and nothing more. While at it, also remove the obvious statement that bugs will be fixed and incooperated into the kernel.

-vlad

Quoted 2 lines
maintainer Applied
#3 lore raw

Re: [PATCH net-next 2/2] net: sctp: trivial: update bug report in header comment

In reply to Daniel Borkmann

From: Daniel Borkmann <[email protected]>
Date: Tue, 6 Aug 2013 21:18:13 +0200

Quoted 7 lines

With the restructuring of the lksctp.org site, we only allow bug reports through the SCTP mailing list [email protected], not via SF, as SF is only used for web hosting and nothing more. While at it, also remove the obvious statement that bugs will be fixed and incooperated into the kernel.

Applied.

#4 lore raw
In reply to Daniel Borkmann
Quoted 4 lines · Daniel Borkmann

Get rid of the last module parameter for SCTP and make this configurable via sysctl for SCTP like all the rest of SCTP's configuration knobs.

But this isn't like the rest of the sctp knobs. Disabling this violates the base protocol and we don't really want to encourage people to do this.

There was a long discussion about it back in 2009 when the original patch was submitted that proposed a sysctl. Nothing has changed since then to convince me that this sysctl would be a good idea.

-vlad

Quoted 148 lines
---
  Documentation/networking/ip-sysctl.txt |  8 ++++++++
  include/net/netns/sctp.h               |  3 +++
  include/net/sctp/structs.h             |  5 -----
  net/sctp/input.c                       |  4 ++--
  net/sctp/output.c                      |  5 ++++-
  net/sctp/protocol.c                    |  5 +++--
  net/sctp/sysctl.c                      | 10 +++++++++-
  7 files changed, 29 insertions(+), 11 deletions(-)
Documentation/networking/ip-sysctl.txt +8 -0
index 36be26b..6f5b813 100644
@@ -1507,6 +1507,14 @@ sack_timeout - INTEGER
 
  	Default: 200
 
+checksum_disable - BOOLEAN
+	Disable SCTP checksum computing and verification for debugging purpose.
+
+	1: Disable checksumming
+	0: Enable checksumming
+
+	Default: 0
+
  valid_cookie_life - INTEGER
  	The default lifetime of the SCTP cookie (in milliseconds).  The cookie
  	is used during association establishment.
include/net/netns/sctp.h +3 -0
index 3573a81..ebfdf1e 100644
@@ -129,6 +129,9 @@ struct netns_sctp {
 
  	/* Threshold for autoclose timeout, in seconds. */
  	unsigned long max_autoclose;
+
+	/* Flag to disable SCTP checksumming. */
+	int checksum_disable;
  };
 
  #endif /* __NETNS_SCTP_H__ */
include/net/sctp/structs.h +0 -5
index d9c93a7..06ebeaa 100644
@@ -141,10 +141,6 @@ extern struct sctp_globals {
  	/* This is the sctp port control hash.	*/
  	int port_hashsize;
  	struct sctp_bind_hashbucket *port_hashtable;
-
-	/* Flag to indicate whether computing and verifying checksum
-	 * is disabled. */
-        bool checksum_disable;
  } sctp_globals;
 
  #define sctp_max_instreams		(sctp_globals.max_instreams)
@@ -156,7 +152,6 @@ extern struct sctp_globals {
  #define sctp_assoc_hashtable		(sctp_globals.assoc_hashtable)
  #define sctp_port_hashsize		(sctp_globals.port_hashsize)
  #define sctp_port_hashtable		(sctp_globals.port_hashtable)
-#define sctp_checksum_disable		(sctp_globals.checksum_disable)
 
  /* SCTP Socket type: UDP or TCP style. */
  typedef enum {
net/sctp/input.c +2 -2
index fa91aff..b9a25e1 100644
@@ -140,8 +140,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 (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-		  sctp_rcv_checksum(net, skb) < 0)
+	if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) &&
+	    sctp_rcv_checksum(net, skb) < 0)
  		goto discard_it;
 
  	skb_pull(skb, sizeof(struct sctphdr));
net/sctp/output.c +4 -1
index 5a55c55d..cdb5f49 100644
@@ -395,6 +395,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
  	int padding;		/* How much padding do we need?  */
  	__u8 has_data = 0;
  	struct dst_entry *dst = tp->dst;
+	struct net *net;
  	unsigned char *auth = NULL;	/* pointer to auth in skb data */
  	__u32 cksum_buf_len = sizeof(struct sctphdr);
 
@@ -541,7 +542,9 @@ 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 <draft-ietf-tsvwg-sctpcsum-02.txt>.
  	 */
-	if (!sctp_checksum_disable) {
+	net = dev_net(dst->dev);
+
+	if (!net->sctp.checksum_disable) {
  		if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
  			__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
net/sctp/protocol.c +3 -2
index b52ec25..a570a63 100644
@@ -1193,6 +1193,9 @@ static int __net_init sctp_net_init(struct net *net)
  	/* Whether Cookie Preservative is enabled(1) or not(0) */
  	net->sctp.cookie_preserve_enable 	= 1;
 
+	/* Whether SCTP checksumming is disabled(1) or not(0) */
+	net->sctp.checksum_disable		= 0;
+
  	/* Default sctp sockets to use md5 as their hmac alg */
  #if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
  	net->sctp.sctp_hmac_alg			= "md5";
@@ -1549,6 +1552,4 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
  MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
  MODULE_AUTHOR("Linux Kernel SCTP developers <[email protected]>");
  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");
net/sctp/sysctl.c +9 -1
index 1906747..754809a 100644
@@ -296,7 +296,15 @@ static struct ctl_table sctp_net_table[] = {
  		.extra1		= &max_autoclose_min,
  		.extra2		= &max_autoclose_max,
  	},
-
+	{
+		.procname	= "checksum_disable",
+		.data		= &init_net.sctp.checksum_disable,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &zero,
+		.extra2		= &one,
+	},
  	{ /* sentinel */ }
  };
 
#5 lore raw
Quoted 6 lines · Vlad Yasevich
Quoted 4 lines · Daniel Borkmann

Get rid of the last module parameter for SCTP and make this configurable via sysctl for SCTP like all the rest of SCTP's configuration knobs.

Quoted 6 lines

But this isn't like the rest of the sctp knobs. Disabling this violates the base protocol and we don't really want to encourage people to do this.

There was a long discussion about it back in 2009 when the original patch was submitted that proposed a sysctl. Nothing has changed since then to convince me that this sysctl would be a good idea.

I agree with Vlad. In FreeBSD this is only a compile time flag used at the time where no checksum offloading was available and during research work people wanted to know how the performance would be when it is available.

Since we have now these nics, not sure if it makes sense to keep it configurable at all...

Best regards
Michael

Quoted 157 lines

-vlad

Quoted 138 lines
---
 Documentation/networking/ip-sysctl.txt |  8 ++++++++
 include/net/netns/sctp.h               |  3 +++
 include/net/sctp/structs.h             |  5 -----
 net/sctp/input.c                       |  4 ++--
 net/sctp/output.c                      |  5 ++++-
 net/sctp/protocol.c                    |  5 +++--
 net/sctp/sysctl.c                      | 10 +++++++++-
 7 files changed, 29 insertions(+), 11 deletions(-)
Documentation/networking/ip-sysctl.txt +8 -0
index 36be26b..6f5b813 100644
@@ -1507,6 +1507,14 @@ sack_timeout - INTEGER
 
 	Default: 200
 
+checksum_disable - BOOLEAN
+	Disable SCTP checksum computing and verification for debugging purpose.
+
+	1: Disable checksumming
+	0: Enable checksumming
+
+	Default: 0
+
 valid_cookie_life - INTEGER
 	The default lifetime of the SCTP cookie (in milliseconds).  The cookie
 	is used during association establishment.
include/net/netns/sctp.h +3 -0
index 3573a81..ebfdf1e 100644
@@ -129,6 +129,9 @@ struct netns_sctp {
 
 	/* Threshold for autoclose timeout, in seconds. */
 	unsigned long max_autoclose;
+
+	/* Flag to disable SCTP checksumming. */
+	int checksum_disable;
 };
 
 #endif /* __NETNS_SCTP_H__ */
include/net/sctp/structs.h +0 -5
index d9c93a7..06ebeaa 100644
@@ -141,10 +141,6 @@ extern struct sctp_globals {
 	/* This is the sctp port control hash.	*/
 	int port_hashsize;
 	struct sctp_bind_hashbucket *port_hashtable;
-
-	/* Flag to indicate whether computing and verifying checksum
-	 * is disabled. */
-        bool checksum_disable;
 } sctp_globals;
 
 #define sctp_max_instreams		(sctp_globals.max_instreams)
@@ -156,7 +152,6 @@ extern struct sctp_globals {
 #define sctp_assoc_hashtable		(sctp_globals.assoc_hashtable)
 #define sctp_port_hashsize		(sctp_globals.port_hashsize)
 #define sctp_port_hashtable		(sctp_globals.port_hashtable)
-#define sctp_checksum_disable		(sctp_globals.checksum_disable)
 
 /* SCTP Socket type: UDP or TCP style. */
 typedef enum {
net/sctp/input.c +2 -2
index fa91aff..b9a25e1 100644
@@ -140,8 +140,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 (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-		  sctp_rcv_checksum(net, skb) < 0)
+	if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) &&
+	    sctp_rcv_checksum(net, skb) < 0)
 		goto discard_it;
 
 	skb_pull(skb, sizeof(struct sctphdr));
net/sctp/output.c +4 -1
index 5a55c55d..cdb5f49 100644
@@ -395,6 +395,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	int padding;		/* How much padding do we need?  */
 	__u8 has_data = 0;
 	struct dst_entry *dst = tp->dst;
+	struct net *net;
 	unsigned char *auth = NULL;	/* pointer to auth in skb data */
 	__u32 cksum_buf_len = sizeof(struct sctphdr);
 
@@ -541,7 +542,9 @@ 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 <draft-ietf-tsvwg-sctpcsum-02.txt>.
 	 */
-	if (!sctp_checksum_disable) {
+	net = dev_net(dst->dev);
+
+	if (!net->sctp.checksum_disable) {
 		if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
 			__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
net/sctp/protocol.c +3 -2
index b52ec25..a570a63 100644
@@ -1193,6 +1193,9 @@ static int __net_init sctp_net_init(struct net *net)
 	/* Whether Cookie Preservative is enabled(1) or not(0) */
 	net->sctp.cookie_preserve_enable 	= 1;
 
+	/* Whether SCTP checksumming is disabled(1) or not(0) */
+	net->sctp.checksum_disable		= 0;
+
 	/* Default sctp sockets to use md5 as their hmac alg */
 #if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
 	net->sctp.sctp_hmac_alg			= "md5";
@@ -1549,6 +1552,4 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
 MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
 MODULE_AUTHOR("Linux Kernel SCTP developers <[email protected]>");
 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");
net/sctp/sysctl.c +2 -1
index 1906747..754809a 100644
@@ -296,7 +296,15 @@ static struct ctl_table sctp_net_table[] = {
 		.extra1		= &max_autoclose_min,
 		.extra2		= &max_autoclose_max,
 	},
-
+	{
+		.procname	= "checksum_disable",

net/sctp/sysctl.c static struct ctl_table sctp_net_table[] = { · line 310

Quoted 10 lines
net/sctp/sysctl.c +7 -0
+		.data		= &init_net.sctp.checksum_disable,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &zero,
+		.extra2		= &one,
+	},
 	{ /* sentinel */ }
 };
 

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Vlad Yasevich
Quoted 6 lines · Vlad Yasevich
Quoted 4 lines · Daniel Borkmann

Get rid of the last module parameter for SCTP and make this configurable via sysctl for SCTP like all the rest of SCTP's configuration knobs.

Quoted 6 lines

But this isn't like the rest of the sctp knobs. Disabling this violates the base protocol and we don't really want to encourage people to do this.

There was a long discussion about it back in 2009 when the original patch was submitted that proposed a sysctl. Nothing has changed since then to convince me that this sysctl would be a good idea.

Ah, okay. I didn't follow that discussion. Actually both can easily be set or unset as it's just /sys/module/sctp/parameters/no_checksums, but I understand your reasoning that sysctl is something more "official".

Quoted 151 lines

-vlad

Quoted 148 lines
---
  Documentation/networking/ip-sysctl.txt |  8 ++++++++
  include/net/netns/sctp.h               |  3 +++
  include/net/sctp/structs.h             |  5 -----
  net/sctp/input.c                       |  4 ++--
  net/sctp/output.c                      |  5 ++++-
  net/sctp/protocol.c                    |  5 +++--
  net/sctp/sysctl.c                      | 10 +++++++++-
  7 files changed, 29 insertions(+), 11 deletions(-)
Documentation/networking/ip-sysctl.txt +8 -0
index 36be26b..6f5b813 100644
@@ -1507,6 +1507,14 @@ sack_timeout - INTEGER
 
      Default: 200
 
+checksum_disable - BOOLEAN
+    Disable SCTP checksum computing and verification for debugging purpose.
+
+    1: Disable checksumming
+    0: Enable checksumming
+
+    Default: 0
+
  valid_cookie_life - INTEGER
      The default lifetime of the SCTP cookie (in milliseconds).  The cookie
      is used during association establishment.
include/net/netns/sctp.h +3 -0
index 3573a81..ebfdf1e 100644
@@ -129,6 +129,9 @@ struct netns_sctp {
 
      /* Threshold for autoclose timeout, in seconds. */
      unsigned long max_autoclose;
+
+    /* Flag to disable SCTP checksumming. */
+    int checksum_disable;
  };
 
  #endif /* __NETNS_SCTP_H__ */
include/net/sctp/structs.h +0 -5
index d9c93a7..06ebeaa 100644
@@ -141,10 +141,6 @@ extern struct sctp_globals {
      /* This is the sctp port control hash.    */
      int port_hashsize;
      struct sctp_bind_hashbucket *port_hashtable;
-
-    /* Flag to indicate whether computing and verifying checksum
-     * is disabled. */
-        bool checksum_disable;
  } sctp_globals;
 
  #define sctp_max_instreams        (sctp_globals.max_instreams)
@@ -156,7 +152,6 @@ extern struct sctp_globals {
  #define sctp_assoc_hashtable        (sctp_globals.assoc_hashtable)
  #define sctp_port_hashsize        (sctp_globals.port_hashsize)
  #define sctp_port_hashtable        (sctp_globals.port_hashtable)
-#define sctp_checksum_disable        (sctp_globals.checksum_disable)
 
  /* SCTP Socket type: UDP or TCP style. */
  typedef enum {
net/sctp/input.c +2 -2
index fa91aff..b9a25e1 100644
@@ -140,8 +140,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 (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-          sctp_rcv_checksum(net, skb) < 0)
+    if (!net->sctp.checksum_disable && !skb_csum_unnecessary(skb) &&
+        sctp_rcv_checksum(net, skb) < 0)
          goto discard_it;
 
      skb_pull(skb, sizeof(struct sctphdr));
net/sctp/output.c +4 -1
index 5a55c55d..cdb5f49 100644
@@ -395,6 +395,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
      int padding;        /* How much padding do we need?  */
      __u8 has_data = 0;
      struct dst_entry *dst = tp->dst;
+    struct net *net;
      unsigned char *auth = NULL;    /* pointer to auth in skb data */
      __u32 cksum_buf_len = sizeof(struct sctphdr);
 
@@ -541,7 +542,9 @@ 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 <draft-ietf-tsvwg-sctpcsum-02.txt>.
       */
-    if (!sctp_checksum_disable) {
+    net = dev_net(dst->dev);
+
+    if (!net->sctp.checksum_disable) {
          if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
              __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
net/sctp/protocol.c +3 -2
index b52ec25..a570a63 100644
@@ -1193,6 +1193,9 @@ static int __net_init sctp_net_init(struct net *net)
      /* Whether Cookie Preservative is enabled(1) or not(0) */
      net->sctp.cookie_preserve_enable     = 1;
 
+    /* Whether SCTP checksumming is disabled(1) or not(0) */
+    net->sctp.checksum_disable        = 0;
+
      /* Default sctp sockets to use md5 as their hmac alg */
  #if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
      net->sctp.sctp_hmac_alg            = "md5";
@@ -1549,6 +1552,4 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
  MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
  MODULE_AUTHOR("Linux Kernel SCTP developers <[email protected]>");
  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");
net/sctp/sysctl.c +9 -1
index 1906747..754809a 100644
@@ -296,7 +296,15 @@ static struct ctl_table sctp_net_table[] = {
          .extra1        = &max_autoclose_min,
          .extra2        = &max_autoclose_max,
      },
-
+    {
+        .procname    = "checksum_disable",
+        .data        = &init_net.sctp.checksum_disable,
+        .maxlen        = sizeof(int),
+        .mode        = 0644,
+        .proc_handler    = proc_dointvec_minmax,
+        .extra1        = &zero,
+        .extra2        = &one,
+    },
      { /* sentinel */ }
  };
 
#8 lore raw
Quoted 10 lines · David Miller

From: Daniel Borkmann <[email protected]>
Date: Tue, 6 Aug 2013 21:18:12 +0200

Quoted 5 lines

Get rid of the last module parameter for SCTP and make this configurable via sysctl for SCTP like all the rest of SCTP's configuration knobs.

Applied.

David

Please revert this. This isn't a knob that that should be so freely exposed. I thought my response to Daniel made that clear.

Thanks
-vlad

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#9 lore raw

From: Vlad Yasevich <[email protected]>
Date: Fri, 09 Aug 2013 14:50:40 -0400

Quoted 3 lines

Please revert this. This isn't a knob that that should be so freely exposed. I thought my response to Daniel made that clear.

Done, sorry about that.