TCP:Fix a bug in strategy_allowed_congestion_control
Subsystems (2)
Stephen Hemminger
Acked-byQuoted 16 lines · On Fri, 25 Jan 2008 15:10:13 +0800 shanwei <[email protected]> wrote:
hi all:
In
strategy_allowed_congestion_controlof the 2.6.24 kernel, whensysctl_stringreturn 1 on success,it should calltcp_set_allowed_congestion_controlto set the allowed congestion control.But, it don't.
thesysctl_stringreturn 1 on success, otherwise return negative, never return 0.The patch fix the problem.Signed-off-by Shan Wei <[email protected]>diff -Nuarp
linux-2.6.24/net/ipv4/sysctl_net_ipv4.clinux-2.6.24-new/net/ipv4/sysctl_net_ipv4.c
net/ipv4/sysctl_net_ipv4.c static int strategy_allowed_congestion_c · line 254
Quoted 8 lines
net/ipv4/sysctl_net_ipv4.c +1
-1@@ -248,7 +248,7 @@ static int strategy_allowed_congestion_ctcp_get_available_congestion_control (tbl.data, tbl.maxlen); ret =sysctl_string (&tbl, name, nlen, oldval, oldlenp, newval, newlen); -if (ret ==0 && newval && newlen) +if (ret ==1 && newval && newlen) ret =tcp_set_allowed_congestion_control (tbl.data);kfree (tbl.data);
This parallels previous fix by Sam Jansen.
Quoted 30 lines · Stephen Hemminger
Quoted 16 lines · On Fri, 25 Jan 2008 15:10:13 +0800 shanwei <[email protected]> wrote:
hi all:
In
strategy_allowed_congestion_controlof the 2.6.24 kernel, whensysctl_stringreturn 1 on success,it should calltcp_set_allowed_congestion_controlto set the allowed congestion control.But, it don't.
thesysctl_stringreturn 1 on success, otherwise return negative, never return 0.The patch fix the problem.Signed-off-by Shan Wei <[email protected]>diff -Nuarp
linux-2.6.24/net/ipv4/sysctl_net_ipv4.clinux-2.6.24-new/net/ipv4/sysctl_net_ipv4.cnet/ipv4/sysctl_net_ipv4.c static int strategy_allowed_congestion_c · line 254
Quoted 8 lines
net/ipv4/sysctl_net_ipv4.c +1
-1@@ -248,7 +248,7 @@ static int strategy_allowed_congestion_ctcp_get_available_congestion_control (tbl.data, tbl.maxlen); ret =sysctl_string (&tbl, name, nlen, oldval, oldlenp, newval, newlen); -if (ret ==0 && newval && newlen) +if (ret ==1 && newval && newlen) ret =tcp_set_allowed_congestion_control (tbl.data);kfree (tbl.data);
Quoted 3 lines
This parallels previous fix by Sam Jansen.
From the link:http://marc.info/?l=linux-netdev&m=119551836927062&w=2, he only fix the sysctl_tcp_congestion_control function.
In the latest kernel, the sysctl_string problem is present. Can this patch be applied?
David Miller
maintainerFrom: shanwei <[email protected]>
Date: Mon, 28 Jan 2008 10:05:35 +0800
Quoted 31 lines
Quoted 30 lines · Stephen Hemminger
Quoted 16 lines · On Fri, 25 Jan 2008 15:10:13 +0800 shanwei <[email protected]> wrote:
hi all:
In
strategy_allowed_congestion_controlof the 2.6.24 kernel, whensysctl_stringreturn 1 on success,it should calltcp_set_allowed_congestion_controlto set the allowed congestion control.But, it don't.
thesysctl_stringreturn 1 on success, otherwise return negative, never return 0.The patch fix the problem.Signed-off-by Shan Wei <[email protected]>diff -Nuarp
linux-2.6.24/net/ipv4/sysctl_net_ipv4.clinux-2.6.24-new/net/ipv4/sysctl_net_ipv4.cnet/ipv4/sysctl_net_ipv4.c static int strategy_allowed_congestion_c · line 254
Quoted 8 lines
net/ipv4/sysctl_net_ipv4.c +1
-1@@ -248,7 +248,7 @@ static int strategy_allowed_congestion_ctcp_get_available_congestion_control (tbl.data, tbl.maxlen); ret =sysctl_string (&tbl, name, nlen, oldval, oldlenp, newval, newlen); -if (ret ==0 && newval && newlen) +if (ret ==1 && newval && newlen) ret =tcp_set_allowed_congestion_control (tbl.data);kfree (tbl.data);
Quoted 7 lines
Quoted 4 lines
This parallels previous fix by Sam Jansen.
From the link:http://marc.info/?l=linux-netdev&m=119551836927062&w=2,
he only fix the
sysctl_tcp_congestion_controlfunction. In the latest kernel, thesysctl_stringproblem is present. Can this patch be applied?
Done.