diff options
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 48 |
1 files changed, 6 insertions, 42 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index f74e4e2cdd06..da0a4d2adc69 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <linux/route.h> | 59 | #include <linux/route.h> |
60 | #include <linux/init.h> | 60 | #include <linux/init.h> |
61 | #include <linux/rcupdate.h> | 61 | #include <linux/rcupdate.h> |
62 | #include <linux/slab.h> | ||
62 | #ifdef CONFIG_SYSCTL | 63 | #ifdef CONFIG_SYSCTL |
63 | #include <linux/sysctl.h> | 64 | #include <linux/sysctl.h> |
64 | #endif | 65 | #endif |
@@ -598,6 +599,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | |||
598 | icmp6h.icmp6_solicited = solicited; | 599 | icmp6h.icmp6_solicited = solicited; |
599 | icmp6h.icmp6_override = override; | 600 | icmp6h.icmp6_override = override; |
600 | 601 | ||
602 | inc_opt |= ifp->idev->cnf.force_tllao; | ||
601 | __ndisc_send(dev, neigh, daddr, src_addr, | 603 | __ndisc_send(dev, neigh, daddr, src_addr, |
602 | &icmp6h, solicited_addr, | 604 | &icmp6h, solicited_addr, |
603 | inc_opt ? ND_OPT_TARGET_LL_ADDR : 0); | 605 | inc_opt ? ND_OPT_TARGET_LL_ADDR : 0); |
@@ -1768,46 +1770,10 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu | |||
1768 | return ret; | 1770 | return ret; |
1769 | } | 1771 | } |
1770 | 1772 | ||
1771 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, | ||
1772 | void __user *oldval, size_t __user *oldlenp, | ||
1773 | void __user *newval, size_t newlen) | ||
1774 | { | ||
1775 | struct net_device *dev = ctl->extra1; | ||
1776 | struct inet6_dev *idev; | ||
1777 | int ret; | ||
1778 | |||
1779 | if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME || | ||
1780 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME) | ||
1781 | ndisc_warn_deprecated_sysctl(ctl, "procfs", dev ? dev->name : "default"); | ||
1782 | |||
1783 | switch (ctl->ctl_name) { | ||
1784 | case NET_NEIGH_REACHABLE_TIME: | ||
1785 | ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen); | ||
1786 | break; | ||
1787 | case NET_NEIGH_RETRANS_TIME_MS: | ||
1788 | case NET_NEIGH_REACHABLE_TIME_MS: | ||
1789 | ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen); | ||
1790 | break; | ||
1791 | default: | ||
1792 | ret = 0; | ||
1793 | } | ||
1794 | |||
1795 | if (newval && newlen && ret > 0 && | ||
1796 | dev && (idev = in6_dev_get(dev)) != NULL) { | ||
1797 | if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME || | ||
1798 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS) | ||
1799 | idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time); | ||
1800 | idev->tstamp = jiffies; | ||
1801 | inet6_ifinfo_notify(RTM_NEWLINK, idev); | ||
1802 | in6_dev_put(idev); | ||
1803 | } | ||
1804 | |||
1805 | return ret; | ||
1806 | } | ||
1807 | 1773 | ||
1808 | #endif | 1774 | #endif |
1809 | 1775 | ||
1810 | static int ndisc_net_init(struct net *net) | 1776 | static int __net_init ndisc_net_init(struct net *net) |
1811 | { | 1777 | { |
1812 | struct ipv6_pinfo *np; | 1778 | struct ipv6_pinfo *np; |
1813 | struct sock *sk; | 1779 | struct sock *sk; |
@@ -1832,7 +1798,7 @@ static int ndisc_net_init(struct net *net) | |||
1832 | return 0; | 1798 | return 0; |
1833 | } | 1799 | } |
1834 | 1800 | ||
1835 | static void ndisc_net_exit(struct net *net) | 1801 | static void __net_exit ndisc_net_exit(struct net *net) |
1836 | { | 1802 | { |
1837 | inet_ctl_sock_destroy(net->ipv6.ndisc_sk); | 1803 | inet_ctl_sock_destroy(net->ipv6.ndisc_sk); |
1838 | } | 1804 | } |
@@ -1855,10 +1821,8 @@ int __init ndisc_init(void) | |||
1855 | neigh_table_init(&nd_tbl); | 1821 | neigh_table_init(&nd_tbl); |
1856 | 1822 | ||
1857 | #ifdef CONFIG_SYSCTL | 1823 | #ifdef CONFIG_SYSCTL |
1858 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, | 1824 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, "ipv6", |
1859 | NET_IPV6_NEIGH, "ipv6", | 1825 | &ndisc_ifinfo_sysctl_change); |
1860 | &ndisc_ifinfo_sysctl_change, | ||
1861 | &ndisc_ifinfo_sysctl_strategy); | ||
1862 | if (err) | 1826 | if (err) |
1863 | goto out_unregister_pernet; | 1827 | goto out_unregister_pernet; |
1864 | #endif | 1828 | #endif |