netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* query: adding a sysctl
@ 2009-10-02  4:00 William Allen Simpson
  2009-10-02  5:57 ` Stephen Hemminger
  0 siblings, 1 reply; 10+ messages in thread
From: William Allen Simpson @ 2009-10-02  4:00 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

[My first post here, hopefully not a FAQ, as I've googled it, but cannot find
the definitive answer.]

I've been trying to add a sysctl, and I've noticed this message:

sysctl table check failed: /net/ipv4/tcp_cookie_size .3.5.126 Unknown sysctl binary path

I modeled the code on sysctl_tcp_syncookies, and apparently I'm missing some
additional magic?  Or does something need to be done other than C?

[-- Attachment #2: sysctl_tcp_cookie_size.txt --]
[-- Type: text/plain, Size: 1993 bytes --]

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index e76d3b2..8c74bec 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -435,6 +435,7 @@ enum
 	NET_TCP_ALLOWED_CONG_CONTROL=123,
 	NET_TCP_MAX_SSTHRESH=124,
 	NET_TCP_FRTO_RESPONSE=125,
+	NET_TCP_COOKIE_SIZE=126,
 };
 
 enum {
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 4710d21..e6174c9 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -340,6 +340,16 @@ static struct ctl_table ipv4_table[] = {
 		.proc_handler	= proc_dointvec_jiffies,
 		.strategy	= sysctl_jiffies
 	},
+#ifdef CONFIG_TCP_OPT_COOKIE_EXTENSION
+	{
+		.ctl_name	= NET_TCP_COOKIE_SIZE,
+		.procname	= "tcp_cookie_size",
+		.data		= &sysctl_tcp_cookie_size,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec
+	},
+#endif
 #ifdef CONFIG_SYN_COOKIES
 	{
 		.ctl_name	= NET_TCP_SYNCOOKIES,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 56b7602..a53b2a8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -208,6 +214,7 @@ extern int sysctl_tcp_synack_retries;
 extern int sysctl_tcp_retries1;
 extern int sysctl_tcp_retries2;
 extern int sysctl_tcp_orphan_retries;
+extern int sysctl_tcp_cookie_size;
 extern int sysctl_tcp_syncookies;
 extern int sysctl_tcp_retrans_collapse;
 extern int sysctl_tcp_stdurg;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5200aab..afbdc30 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -59,6 +59,14 @@ int sysctl_tcp_base_mss __read_mostly = 512;
 /* By default, RFC2861 behavior.  */
 int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
 
+#ifdef CONFIG_SYSCTL
+/* By default, let the user enable it. */
+int sysctl_tcp_cookie_size __read_mostly = 0;
+#else
+int sysctl_tcp_cookie_size __read_mostly = TCP_COOKIE_MAX;
+#endif
+
+
 /* Account for new data that has been sent to the network. */
 static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb)
 {

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-03  6:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02  4:00 query: adding a sysctl William Allen Simpson
2009-10-02  5:57 ` Stephen Hemminger
2009-10-02 14:58   ` [PATCH] TCPCT-1: " William Allen Simpson
2009-10-02 17:52     ` William Allen Simpson
2009-10-02 22:00       ` William Allen Simpson
2009-10-02 21:06     ` Andi Kleen
2009-10-02 21:46       ` William Allen Simpson
2009-10-02 22:48         ` David Miller
2009-10-03  0:32           ` William Allen Simpson
2009-10-03  6:26             ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).