Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

igmp: net: Move igmp namespace init to correct file

When igmp related sysctl were namespacified their initializatin was
erroneously put into the tcp socket namespace constructor. This
patch moves the relevant code into the igmp namespace constructor to
keep things consistent.

Also sprinkle some #ifdefs to silence warnings

Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nikolay Borisov and committed by
David S. Miller
dcd87999 fa50d974

+14 -6
+14
net/ipv4/igmp.c
··· 1224 1224 static void igmp_group_added(struct ip_mc_list *im) 1225 1225 { 1226 1226 struct in_device *in_dev = im->interface; 1227 + #ifdef CONFIG_IP_MULTICAST 1227 1228 struct net *net = dev_net(in_dev->dev); 1229 + #endif 1228 1230 1229 1231 if (im->loaded == 0) { 1230 1232 im->loaded = 1; ··· 1318 1316 void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) 1319 1317 { 1320 1318 struct ip_mc_list *im; 1319 + #ifdef CONFIG_IP_MULTICAST 1321 1320 struct net *net = dev_net(in_dev->dev); 1321 + #endif 1322 1322 1323 1323 ASSERT_RTNL(); 1324 1324 ··· 1647 1643 1648 1644 void ip_mc_init_dev(struct in_device *in_dev) 1649 1645 { 1646 + #ifdef CONFIG_IP_MULTICAST 1650 1647 struct net *net = dev_net(in_dev->dev); 1648 + #endif 1651 1649 ASSERT_RTNL(); 1652 1650 1653 1651 #ifdef CONFIG_IP_MULTICAST ··· 1668 1662 void ip_mc_up(struct in_device *in_dev) 1669 1663 { 1670 1664 struct ip_mc_list *pmc; 1665 + #ifdef CONFIG_IP_MULTICAST 1671 1666 struct net *net = dev_net(in_dev->dev); 1667 + #endif 1672 1668 1673 1669 ASSERT_RTNL(); 1674 1670 ··· 2931 2923 goto out_sock; 2932 2924 } 2933 2925 2926 + /* Sysctl initialization */ 2927 + net->ipv4.sysctl_igmp_max_memberships = 20; 2928 + net->ipv4.sysctl_igmp_max_msf = 10; 2929 + /* IGMP reports for link-local multicast groups are enabled by default */ 2930 + net->ipv4.sysctl_igmp_llm_reports = 1; 2931 + net->ipv4.sysctl_igmp_qrv = 2; 2934 2932 return 0; 2935 2933 2936 2934 out_sock:
-6
net/ipv4/tcp_ipv4.c
··· 2399 2399 net->ipv4.sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; 2400 2400 net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; 2401 2401 2402 - net->ipv4.sysctl_igmp_max_memberships = 20; 2403 - net->ipv4.sysctl_igmp_max_msf = 10; 2404 - /* IGMP reports for link-local multicast groups are enabled by default */ 2405 - net->ipv4.sysctl_igmp_llm_reports = 1; 2406 - net->ipv4.sysctl_igmp_qrv = 2; 2407 - 2408 2402 return 0; 2409 2403 fail: 2410 2404 tcp_sk_exit(net);