* [PATCH] igmp: Fix regression caused by igmp sysctl namespace code.
@ 2017-08-09 5:52 Nikolay Borisov
2017-08-09 7:06 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2017-08-09 5:52 UTC (permalink / raw)
To: davem; +Cc: kuznet, yoshfuji, netdev, Nikolay Borisov, # 4 . 6
Commit dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
moved the igmp sysctls initialization from tcp_sk_init to igmp_net_init. This
function is only called as part of per-namespace initialization, only if
CONFIG_IP_MULTICAST is defined, otherwise igmp_mc_init() call in ip_init is
compiled out, casuing the igmp pernet ops to not be registerd and those sysctl
being left initialized with 0. However, there are certain functions, such as
ip_mc_join_group which are always compiled and make use of some of those
sysctls. Let's do a partial revert of the aforementioned commit and move the
sysctl initialization back into tcp_sk_init, that way they will always have
sane values.
Fixes: dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196595
Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Cc: <stable@vger.kernel.org> # 4.6
---
net/ipv4/igmp.c | 6 ------
net/ipv4/tcp_ipv4.c | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 28f14afd0dd3..498706b072fb 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2974,12 +2974,6 @@ static int __net_init igmp_net_init(struct net *net)
goto out_sock;
}
- /* Sysctl initialization */
- net->ipv4.sysctl_igmp_max_memberships = 20;
- net->ipv4.sysctl_igmp_max_msf = 10;
- /* IGMP reports for link-local multicast groups are enabled by default */
- net->ipv4.sysctl_igmp_llm_reports = 1;
- net->ipv4.sysctl_igmp_qrv = 2;
return 0;
out_sock:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index a20e7f03d5f7..64ba2c93d396 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2528,6 +2528,12 @@ static int __net_init tcp_sk_init(struct net *net)
net->ipv4.sysctl_tcp_window_scaling = 1;
net->ipv4.sysctl_tcp_timestamps = 1;
+ net->ipv4.sysctl_igmp_max_memberships = 20;
+ net->ipv4.sysctl_igmp_max_msf = 10;
+ /* IGMP reports for link-local multicast groups are enabled by default */
+ net->ipv4.sysctl_igmp_llm_reports = 1;
+ net->ipv4.sysctl_igmp_qrv = 2;
+
return 0;
fail:
tcp_sk_exit(net);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] igmp: Fix regression caused by igmp sysctl namespace code.
2017-08-09 5:52 [PATCH] igmp: Fix regression caused by igmp sysctl namespace code Nikolay Borisov
@ 2017-08-09 7:06 ` Eric Dumazet
2017-08-09 11:38 ` [PATCHv2] " Nikolay Borisov
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2017-08-09 7:06 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: davem, kuznet, yoshfuji, netdev, # 4 . 6
On Wed, 2017-08-09 at 08:52 +0300, Nikolay Borisov wrote:
> Commit dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
> moved the igmp sysctls initialization from tcp_sk_init to igmp_net_init. This
> function is only called as part of per-namespace initialization, only if
> CONFIG_IP_MULTICAST is defined, otherwise igmp_mc_init() call in ip_init is
> compiled out, casuing the igmp pernet ops to not be registerd and those sysctl
> being left initialized with 0. However, there are certain functions, such as
> ip_mc_join_group which are always compiled and make use of some of those
> sysctls. Let's do a partial revert of the aforementioned commit and move the
> sysctl initialization back into tcp_sk_init, that way they will always have
> sane values.
>
> Fixes: dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196595
> Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
> Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> Cc: <stable@vger.kernel.org> # 4.6
> ---
> net/ipv4/igmp.c | 6 ------
> net/ipv4/tcp_ipv4.c | 6 ++++++
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index 28f14afd0dd3..498706b072fb 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -2974,12 +2974,6 @@ static int __net_init igmp_net_init(struct net *net)
> goto out_sock;
> }
>
> - /* Sysctl initialization */
> - net->ipv4.sysctl_igmp_max_memberships = 20;
> - net->ipv4.sysctl_igmp_max_msf = 10;
> - /* IGMP reports for link-local multicast groups are enabled by default */
> - net->ipv4.sysctl_igmp_llm_reports = 1;
> - net->ipv4.sysctl_igmp_qrv = 2;
> return 0;
>
> out_sock:
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index a20e7f03d5f7..64ba2c93d396 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -2528,6 +2528,12 @@ static int __net_init tcp_sk_init(struct net *net)
> net->ipv4.sysctl_tcp_window_scaling = 1;
> net->ipv4.sysctl_tcp_timestamps = 1;
>
> + net->ipv4.sysctl_igmp_max_memberships = 20;
> + net->ipv4.sysctl_igmp_max_msf = 10;
> + /* IGMP reports for link-local multicast groups are enabled by default */
> + net->ipv4.sysctl_igmp_llm_reports = 1;
> + net->ipv4.sysctl_igmp_qrv = 2;
> +
>
I would rather move this to inet_init_net(), since IGMP does not belong
to TCP.
Thanks !
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCHv2] igmp: Fix regression caused by igmp sysctl namespace code.
2017-08-09 7:06 ` Eric Dumazet
@ 2017-08-09 11:38 ` Nikolay Borisov
2017-08-10 5:47 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2017-08-09 11:38 UTC (permalink / raw)
To: davem; +Cc: kuznet, yoshfuji, netdev, eric.dumazet, Nikolay Borisov, # 4 . 6
Commit dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
moved the igmp sysctls initialization from tcp_sk_init to igmp_net_init. This
function is only called as part of per-namespace initialization, only if
CONFIG_IP_MULTICAST is defined, otherwise igmp_mc_init() call in ip_init is
compiled out, casuing the igmp pernet ops to not be registerd and those sysctl
being left initialized with 0. However, there are certain functions, such as
ip_mc_join_group which are always compiled and make use of some of those
sysctls. Let's do a partial revert of the aforementioned commit and move the
sysctl initialization into inet_init_net, that way they will always have
sane values.
Fixes: dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196595
Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
Cc: <stable@vger.kernel.org> # 4.6
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
Cahnges since v1:
* Moved the sysctl initialization to inet_init_net based on Eric Dumazet's
suggestion
net/ipv4/af_inet.c | 7 +++++++
net/ipv4/igmp.c | 6 ------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 76c2077c3f5b..2e548eca3489 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1731,6 +1731,13 @@ static __net_init int inet_init_net(struct net *net)
net->ipv4.sysctl_ip_prot_sock = PROT_SOCK;
#endif
+ /* Some igmp sysctl, whose values are always used */
+ net->ipv4.sysctl_igmp_max_memberships = 20;
+ net->ipv4.sysctl_igmp_max_msf = 10;
+ /* IGMP reports for link-local multicast groups are enabled by default */
+ net->ipv4.sysctl_igmp_llm_reports = 1;
+ net->ipv4.sysctl_igmp_qrv = 2;
+
return 0;
}
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 28f14afd0dd3..498706b072fb 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2974,12 +2974,6 @@ static int __net_init igmp_net_init(struct net *net)
goto out_sock;
}
- /* Sysctl initialization */
- net->ipv4.sysctl_igmp_max_memberships = 20;
- net->ipv4.sysctl_igmp_max_msf = 10;
- /* IGMP reports for link-local multicast groups are enabled by default */
- net->ipv4.sysctl_igmp_llm_reports = 1;
- net->ipv4.sysctl_igmp_qrv = 2;
return 0;
out_sock:
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] igmp: Fix regression caused by igmp sysctl namespace code.
2017-08-09 11:38 ` [PATCHv2] " Nikolay Borisov
@ 2017-08-10 5:47 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-08-10 5:47 UTC (permalink / raw)
To: nborisov; +Cc: kuznet, yoshfuji, netdev, eric.dumazet, stable
From: Nikolay Borisov <nborisov@suse.com>
Date: Wed, 9 Aug 2017 14:38:04 +0300
> Commit dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
> moved the igmp sysctls initialization from tcp_sk_init to igmp_net_init. This
> function is only called as part of per-namespace initialization, only if
> CONFIG_IP_MULTICAST is defined, otherwise igmp_mc_init() call in ip_init is
> compiled out, casuing the igmp pernet ops to not be registerd and those sysctl
> being left initialized with 0. However, there are certain functions, such as
> ip_mc_join_group which are always compiled and make use of some of those
> sysctls. Let's do a partial revert of the aforementioned commit and move the
> sysctl initialization into inet_init_net, that way they will always have
> sane values.
>
> Fixes: dcd87999d415 ("igmp: net: Move igmp namespace init to correct file")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196595
> Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
> Cc: <stable@vger.kernel.org> # 4.6
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Please do not use "CC: stable.." for networking patches, I take care of
-stable submissions by hand for those.
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-10 5:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 5:52 [PATCH] igmp: Fix regression caused by igmp sysctl namespace code Nikolay Borisov
2017-08-09 7:06 ` Eric Dumazet
2017-08-09 11:38 ` [PATCHv2] " Nikolay Borisov
2017-08-10 5:47 ` 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).