diff options
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index c400b874097a..b3295d82fece 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -84,6 +84,7 @@ | |||
84 | 84 | ||
85 | #include <net/flow.h> | 85 | #include <net/flow.h> |
86 | #include <net/ip6_checksum.h> | 86 | #include <net/ip6_checksum.h> |
87 | #include <net/inet_common.h> | ||
87 | #include <linux/proc_fs.h> | 88 | #include <linux/proc_fs.h> |
88 | 89 | ||
89 | #include <linux/netfilter.h> | 90 | #include <linux/netfilter.h> |
@@ -1771,12 +1772,12 @@ static int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, | |||
1771 | 1772 | ||
1772 | static int ndisc_net_init(struct net *net) | 1773 | static int ndisc_net_init(struct net *net) |
1773 | { | 1774 | { |
1774 | struct socket *sock; | ||
1775 | struct ipv6_pinfo *np; | 1775 | struct ipv6_pinfo *np; |
1776 | struct sock *sk; | 1776 | struct sock *sk; |
1777 | int err; | 1777 | int err; |
1778 | 1778 | ||
1779 | err = sock_create_kern(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &sock); | 1779 | err = inet_ctl_sock_create(&sk, PF_INET6, |
1780 | SOCK_RAW, IPPROTO_ICMPV6, net); | ||
1780 | if (err < 0) { | 1781 | if (err < 0) { |
1781 | ND_PRINTK0(KERN_ERR | 1782 | ND_PRINTK0(KERN_ERR |
1782 | "ICMPv6 NDISC: Failed to initialize the control socket (err %d).\n", | 1783 | "ICMPv6 NDISC: Failed to initialize the control socket (err %d).\n", |
@@ -1784,22 +1785,19 @@ static int ndisc_net_init(struct net *net) | |||
1784 | return err; | 1785 | return err; |
1785 | } | 1786 | } |
1786 | 1787 | ||
1787 | net->ipv6.ndisc_sk = sk = sock->sk; | 1788 | net->ipv6.ndisc_sk = sk; |
1788 | sk_change_net(sk, net); | ||
1789 | 1789 | ||
1790 | np = inet6_sk(sk); | 1790 | np = inet6_sk(sk); |
1791 | sk->sk_allocation = GFP_ATOMIC; | ||
1792 | np->hop_limit = 255; | 1791 | np->hop_limit = 255; |
1793 | /* Do not loopback ndisc messages */ | 1792 | /* Do not loopback ndisc messages */ |
1794 | np->mc_loop = 0; | 1793 | np->mc_loop = 0; |
1795 | sk->sk_prot->unhash(sk); | ||
1796 | 1794 | ||
1797 | return 0; | 1795 | return 0; |
1798 | } | 1796 | } |
1799 | 1797 | ||
1800 | static void ndisc_net_exit(struct net *net) | 1798 | static void ndisc_net_exit(struct net *net) |
1801 | { | 1799 | { |
1802 | sk_release_kernel(net->ipv6.ndisc_sk); | 1800 | inet_ctl_sock_destroy(net->ipv6.ndisc_sk); |
1803 | } | 1801 | } |
1804 | 1802 | ||
1805 | static struct pernet_operations ndisc_net_ops = { | 1803 | static struct pernet_operations ndisc_net_ops = { |