Skip to content

Commit 72c1d3b

Browse files
congwangdavem330
authored andcommitted
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 <[email protected]> Cc: David S. Miller <[email protected]> Cc: Patrick McHardy <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c49fa01 commit 72c1d3b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

include/net/ip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct packet_type;
9090
struct rtable;
9191
struct sockaddr;
9292

93-
int igmp_mc_proc_init(void);
93+
int igmp_mc_init(void);
9494

9595
/*
9696
* Functions provided by ip.c

net/ipv4/igmp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,7 @@ static struct pernet_operations igmp_net_ops = {
27622762
.init = igmp_net_init,
27632763
.exit = igmp_net_exit,
27642764
};
2765+
#endif
27652766

27662767
static int igmp_netdev_event(struct notifier_block *this,
27672768
unsigned long event, void *ptr)
@@ -2785,8 +2786,9 @@ static struct notifier_block igmp_notifier = {
27852786
.notifier_call = igmp_netdev_event,
27862787
};
27872788

2788-
int __init igmp_mc_proc_init(void)
2789+
int __init igmp_mc_init(void)
27892790
{
2791+
#if defined(CONFIG_PROC_FS)
27902792
int err;
27912793

27922794
err = register_pernet_subsys(&igmp_net_ops);
@@ -2800,5 +2802,7 @@ int __init igmp_mc_proc_init(void)
28002802
reg_notif_fail:
28012803
unregister_pernet_subsys(&igmp_net_ops);
28022804
return err;
2803-
}
2805+
#else
2806+
return register_netdevice_notifier(&igmp_notifier);
28042807
#endif
2808+
}

net/ipv4/ip_output.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ void __init ip_init(void)
15531553
ip_rt_init();
15541554
inet_initpeers();
15551555

1556-
#if defined(CONFIG_IP_MULTICAST) && defined(CONFIG_PROC_FS)
1557-
igmp_mc_proc_init();
1556+
#if defined(CONFIG_IP_MULTICAST)
1557+
igmp_mc_init();
15581558
#endif
15591559
}

0 commit comments

Comments
 (0)