diff options
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 4b1172d73e03..5cb1ef4ce292 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -97,6 +97,7 @@ | |||
97 | #include <net/route.h> | 97 | #include <net/route.h> |
98 | #include <net/sock.h> | 98 | #include <net/sock.h> |
99 | #include <net/checksum.h> | 99 | #include <net/checksum.h> |
100 | #include <net/inet_common.h> | ||
100 | #include <linux/netfilter_ipv4.h> | 101 | #include <linux/netfilter_ipv4.h> |
101 | #ifdef CONFIG_IP_MROUTE | 102 | #ifdef CONFIG_IP_MROUTE |
102 | #include <linux/mroute.h> | 103 | #include <linux/mroute.h> |
@@ -2740,6 +2741,7 @@ static const struct file_operations igmp_mcf_seq_fops = { | |||
2740 | static int __net_init igmp_net_init(struct net *net) | 2741 | static int __net_init igmp_net_init(struct net *net) |
2741 | { | 2742 | { |
2742 | struct proc_dir_entry *pde; | 2743 | struct proc_dir_entry *pde; |
2744 | int err; | ||
2743 | 2745 | ||
2744 | pde = proc_create("igmp", S_IRUGO, net->proc_net, &igmp_mc_seq_fops); | 2746 | pde = proc_create("igmp", S_IRUGO, net->proc_net, &igmp_mc_seq_fops); |
2745 | if (!pde) | 2747 | if (!pde) |
@@ -2748,8 +2750,18 @@ static int __net_init igmp_net_init(struct net *net) | |||
2748 | &igmp_mcf_seq_fops); | 2750 | &igmp_mcf_seq_fops); |
2749 | if (!pde) | 2751 | if (!pde) |
2750 | goto out_mcfilter; | 2752 | goto out_mcfilter; |
2753 | err = inet_ctl_sock_create(&net->ipv4.mc_autojoin_sk, AF_INET, | ||
2754 | SOCK_DGRAM, 0, net); | ||
2755 | if (err < 0) { | ||
2756 | pr_err("Failed to initialize the IGMP autojoin socket (err %d)\n", | ||
2757 | err); | ||
2758 | goto out_sock; | ||
2759 | } | ||
2760 | |||
2751 | return 0; | 2761 | return 0; |
2752 | 2762 | ||
2763 | out_sock: | ||
2764 | remove_proc_entry("mcfilter", net->proc_net); | ||
2753 | out_mcfilter: | 2765 | out_mcfilter: |
2754 | remove_proc_entry("igmp", net->proc_net); | 2766 | remove_proc_entry("igmp", net->proc_net); |
2755 | out_igmp: | 2767 | out_igmp: |
@@ -2760,6 +2772,7 @@ static void __net_exit igmp_net_exit(struct net *net) | |||
2760 | { | 2772 | { |
2761 | remove_proc_entry("mcfilter", net->proc_net); | 2773 | remove_proc_entry("mcfilter", net->proc_net); |
2762 | remove_proc_entry("igmp", net->proc_net); | 2774 | remove_proc_entry("igmp", net->proc_net); |
2775 | inet_ctl_sock_destroy(net->ipv4.mc_autojoin_sk); | ||
2763 | } | 2776 | } |
2764 | 2777 | ||
2765 | static struct pernet_operations igmp_net_ops = { | 2778 | static struct pernet_operations igmp_net_ops = { |