Browse Source

ipv4: register igmp_notifier even when !CONFIG_PROC_FS

We still need this notifier even when we don't config
PROC_FS.

It should be rare to have a kernel without PROC_FS,
so just for completeness.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
WANG Cong 11 years ago
parent
commit
72c1d3bdd5
3 changed files with 9 additions and 5 deletions
  1. 1 1
      include/net/ip.h
  2. 6 2
      net/ipv4/igmp.c
  3. 2 2
      net/ipv4/ip_output.c

+ 1 - 1
include/net/ip.h

@@ -90,7 +90,7 @@ struct packet_type;
 struct rtable;
 struct rtable;
 struct sockaddr;
 struct sockaddr;
 
 
-int igmp_mc_proc_init(void);
+int igmp_mc_init(void);
 
 
 /*
 /*
  *	Functions provided by ip.c
  *	Functions provided by ip.c

+ 6 - 2
net/ipv4/igmp.c

@@ -2762,6 +2762,7 @@ static struct pernet_operations igmp_net_ops = {
 	.init = igmp_net_init,
 	.init = igmp_net_init,
 	.exit = igmp_net_exit,
 	.exit = igmp_net_exit,
 };
 };
+#endif
 
 
 static int igmp_netdev_event(struct notifier_block *this,
 static int igmp_netdev_event(struct notifier_block *this,
 			     unsigned long event, void *ptr)
 			     unsigned long event, void *ptr)
@@ -2785,8 +2786,9 @@ static struct notifier_block igmp_notifier = {
 	.notifier_call = igmp_netdev_event,
 	.notifier_call = igmp_netdev_event,
 };
 };
 
 
-int __init igmp_mc_proc_init(void)
+int __init igmp_mc_init(void)
 {
 {
+#if defined(CONFIG_PROC_FS)
 	int err;
 	int err;
 
 
 	err = register_pernet_subsys(&igmp_net_ops);
 	err = register_pernet_subsys(&igmp_net_ops);
@@ -2800,5 +2802,7 @@ int __init igmp_mc_proc_init(void)
 reg_notif_fail:
 reg_notif_fail:
 	unregister_pernet_subsys(&igmp_net_ops);
 	unregister_pernet_subsys(&igmp_net_ops);
 	return err;
 	return err;
-}
+#else
+	return register_netdevice_notifier(&igmp_notifier);
 #endif
 #endif
+}

+ 2 - 2
net/ipv4/ip_output.c

@@ -1553,7 +1553,7 @@ void __init ip_init(void)
 	ip_rt_init();
 	ip_rt_init();
 	inet_initpeers();
 	inet_initpeers();
 
 
-#if defined(CONFIG_IP_MULTICAST) && defined(CONFIG_PROC_FS)
-	igmp_mc_proc_init();
+#if defined(CONFIG_IP_MULTICAST)
+	igmp_mc_init();
 #endif
 #endif
 }
 }