aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/sysctl_net_ipv4.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2017-11-14 11:25:49 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-15 00:09:52 -0500
commit6670e152447732ba90626f36dfc015a13fbf150e (patch)
tree0848d15b1d27139ee651c8ecae0136bb679f205a /net/ipv4/sysctl_net_ipv4.c
parent11bf284f81b46f59d5f4a4522c13aa7852cfd560 (diff)
tcp: Namespace-ify sysctl_tcp_default_congestion_control
Make default TCP default congestion control to a per namespace value. This changes default congestion control to a pointer to congestion ops (rather than implicit as first element of available lsit). The congestion control setting of new namespaces is inherited from the current setting of the root namespace. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index ef0ff3357a44..93e172118a94 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -201,6 +201,8 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write,
201static int proc_tcp_congestion_control(struct ctl_table *ctl, int write, 201static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,
202 void __user *buffer, size_t *lenp, loff_t *ppos) 202 void __user *buffer, size_t *lenp, loff_t *ppos)
203{ 203{
204 struct net *net = container_of(ctl->data, struct net,
205 ipv4.tcp_congestion_control);
204 char val[TCP_CA_NAME_MAX]; 206 char val[TCP_CA_NAME_MAX];
205 struct ctl_table tbl = { 207 struct ctl_table tbl = {
206 .data = val, 208 .data = val,
@@ -208,11 +210,11 @@ static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,
208 }; 210 };
209 int ret; 211 int ret;
210 212
211 tcp_get_default_congestion_control(val); 213 tcp_get_default_congestion_control(net, val);
212 214
213 ret = proc_dostring(&tbl, write, buffer, lenp, ppos); 215 ret = proc_dostring(&tbl, write, buffer, lenp, ppos);
214 if (write && ret == 0) 216 if (write && ret == 0)
215 ret = tcp_set_default_congestion_control(val); 217 ret = tcp_set_default_congestion_control(net, val);
216 return ret; 218 return ret;
217} 219}
218 220
@@ -447,12 +449,6 @@ static struct ctl_table ipv4_table[] = {
447 .mode = 0644, 449 .mode = 0644,
448 .proc_handler = proc_dointvec 450 .proc_handler = proc_dointvec
449 }, 451 },
450 {
451 .procname = "tcp_congestion_control",
452 .mode = 0644,
453 .maxlen = TCP_CA_NAME_MAX,
454 .proc_handler = proc_tcp_congestion_control,
455 },
456#ifdef CONFIG_NETLABEL 452#ifdef CONFIG_NETLABEL
457 { 453 {
458 .procname = "cipso_cache_enable", 454 .procname = "cipso_cache_enable",
@@ -764,6 +760,13 @@ static struct ctl_table ipv4_net_table[] = {
764 }, 760 },
765#endif 761#endif
766 { 762 {
763 .procname = "tcp_congestion_control",
764 .data = &init_net.ipv4.tcp_congestion_control,
765 .mode = 0644,
766 .maxlen = TCP_CA_NAME_MAX,
767 .proc_handler = proc_tcp_congestion_control,
768 },
769 {
767 .procname = "tcp_keepalive_time", 770 .procname = "tcp_keepalive_time",
768 .data = &init_net.ipv4.sysctl_tcp_keepalive_time, 771 .data = &init_net.ipv4.sysctl_tcp_keepalive_time,
769 .maxlen = sizeof(int), 772 .maxlen = sizeof(int),