aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorNikolay Borisov <kernel@kyup.com>2016-02-15 05:11:28 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-16 20:42:54 -0500
commitdcd87999d415d39cf2ae510bfed6b8206d778e1c (patch)
tree09e9faac10dbe5ae9d4ab503add767de9a8a5e28 /net/ipv4
parentfa50d974d104113630d68b7d03233a6686230d0c (diff)
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/igmp.c14
-rw-r--r--net/ipv4/tcp_ipv4.c6
2 files changed, 14 insertions, 6 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 7c95335bf85e..2aea9f1a2a31 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1224,7 +1224,9 @@ static void igmp_group_dropped(struct ip_mc_list *im)
1224static void igmp_group_added(struct ip_mc_list *im) 1224static void igmp_group_added(struct ip_mc_list *im)
1225{ 1225{
1226 struct in_device *in_dev = im->interface; 1226 struct in_device *in_dev = im->interface;
1227#ifdef CONFIG_IP_MULTICAST
1227 struct net *net = dev_net(in_dev->dev); 1228 struct net *net = dev_net(in_dev->dev);
1229#endif
1228 1230
1229 if (im->loaded == 0) { 1231 if (im->loaded == 0) {
1230 im->loaded = 1; 1232 im->loaded = 1;
@@ -1316,7 +1318,9 @@ static void ip_mc_hash_remove(struct in_device *in_dev,
1316void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) 1318void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
1317{ 1319{
1318 struct ip_mc_list *im; 1320 struct ip_mc_list *im;
1321#ifdef CONFIG_IP_MULTICAST
1319 struct net *net = dev_net(in_dev->dev); 1322 struct net *net = dev_net(in_dev->dev);
1323#endif
1320 1324
1321 ASSERT_RTNL(); 1325 ASSERT_RTNL();
1322 1326
@@ -1643,7 +1647,9 @@ void ip_mc_down(struct in_device *in_dev)
1643 1647
1644void ip_mc_init_dev(struct in_device *in_dev) 1648void ip_mc_init_dev(struct in_device *in_dev)
1645{ 1649{
1650#ifdef CONFIG_IP_MULTICAST
1646 struct net *net = dev_net(in_dev->dev); 1651 struct net *net = dev_net(in_dev->dev);
1652#endif
1647 ASSERT_RTNL(); 1653 ASSERT_RTNL();
1648 1654
1649#ifdef CONFIG_IP_MULTICAST 1655#ifdef CONFIG_IP_MULTICAST
@@ -1662,7 +1668,9 @@ void ip_mc_init_dev(struct in_device *in_dev)
1662void ip_mc_up(struct in_device *in_dev) 1668void ip_mc_up(struct in_device *in_dev)
1663{ 1669{
1664 struct ip_mc_list *pmc; 1670 struct ip_mc_list *pmc;
1671#ifdef CONFIG_IP_MULTICAST
1665 struct net *net = dev_net(in_dev->dev); 1672 struct net *net = dev_net(in_dev->dev);
1673#endif
1666 1674
1667 ASSERT_RTNL(); 1675 ASSERT_RTNL();
1668 1676
@@ -2923,6 +2931,12 @@ static int __net_init igmp_net_init(struct net *net)
2923 goto out_sock; 2931 goto out_sock;
2924 } 2932 }
2925 2933
2934 /* Sysctl initialization */
2935 net->ipv4.sysctl_igmp_max_memberships = 20;
2936 net->ipv4.sysctl_igmp_max_msf = 10;
2937 /* IGMP reports for link-local multicast groups are enabled by default */
2938 net->ipv4.sysctl_igmp_llm_reports = 1;
2939 net->ipv4.sysctl_igmp_qrv = 2;
2926 return 0; 2940 return 0;
2927 2941
2928out_sock: 2942out_sock:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ba5d0146e3f0..3f872a6bc274 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2399,12 +2399,6 @@ static int __net_init tcp_sk_init(struct net *net)
2399 net->ipv4.sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; 2399 net->ipv4.sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT;
2400 net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; 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 return 0; 2402 return 0;
2409fail: 2403fail:
2410 tcp_sk_exit(net); 2404 tcp_sk_exit(net);