|
@@ -222,6 +222,8 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
|
|
/* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */
|
|
/* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */
|
|
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
|
|
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
|
|
const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
|
|
const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
|
|
|
|
+const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT;
|
|
|
|
+const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
|
|
|
|
|
|
/* Check if a valid qdisc is available */
|
|
/* Check if a valid qdisc is available */
|
|
static inline int addrconf_qdisc_ok(struct net_device *dev)
|
|
static inline int addrconf_qdisc_ok(struct net_device *dev)
|
|
@@ -321,7 +323,6 @@ EXPORT_SYMBOL(in6_dev_finish_destroy);
|
|
static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
|
|
static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
|
|
{
|
|
{
|
|
struct inet6_dev *ndev;
|
|
struct inet6_dev *ndev;
|
|
- struct in6_addr maddr;
|
|
|
|
|
|
|
|
ASSERT_RTNL();
|
|
ASSERT_RTNL();
|
|
|
|
|
|
@@ -406,8 +407,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
|
|
rcu_assign_pointer(dev->ip6_ptr, ndev);
|
|
rcu_assign_pointer(dev->ip6_ptr, ndev);
|
|
|
|
|
|
/* Join all-node multicast group */
|
|
/* Join all-node multicast group */
|
|
- ipv6_addr_all_nodes(&maddr);
|
|
|
|
- ipv6_dev_mc_inc(dev, &maddr);
|
|
|
|
|
|
+ ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
|
|
|
|
|
|
return ndev;
|
|
return ndev;
|
|
}
|
|
}
|
|
@@ -433,18 +433,15 @@ static void dev_forward_change(struct inet6_dev *idev)
|
|
{
|
|
{
|
|
struct net_device *dev;
|
|
struct net_device *dev;
|
|
struct inet6_ifaddr *ifa;
|
|
struct inet6_ifaddr *ifa;
|
|
- struct in6_addr addr;
|
|
|
|
|
|
|
|
if (!idev)
|
|
if (!idev)
|
|
return;
|
|
return;
|
|
dev = idev->dev;
|
|
dev = idev->dev;
|
|
if (dev && (dev->flags & IFF_MULTICAST)) {
|
|
if (dev && (dev->flags & IFF_MULTICAST)) {
|
|
- ipv6_addr_all_routers(&addr);
|
|
|
|
-
|
|
|
|
if (idev->cnf.forwarding)
|
|
if (idev->cnf.forwarding)
|
|
- ipv6_dev_mc_inc(dev, &addr);
|
|
|
|
|
|
+ ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
|
|
else
|
|
else
|
|
- ipv6_dev_mc_dec(dev, &addr);
|
|
|
|
|
|
+ ipv6_dev_mc_dec(dev, &in6addr_linklocal_allrouters);
|
|
}
|
|
}
|
|
for (ifa=idev->addr_list; ifa; ifa=ifa->if_next) {
|
|
for (ifa=idev->addr_list; ifa; ifa=ifa->if_next) {
|
|
if (ifa->flags&IFA_F_TENTATIVE)
|
|
if (ifa->flags&IFA_F_TENTATIVE)
|
|
@@ -2654,8 +2651,6 @@ static void addrconf_rs_timer(unsigned long data)
|
|
|
|
|
|
spin_lock(&ifp->lock);
|
|
spin_lock(&ifp->lock);
|
|
if (ifp->probes++ < ifp->idev->cnf.rtr_solicits) {
|
|
if (ifp->probes++ < ifp->idev->cnf.rtr_solicits) {
|
|
- struct in6_addr all_routers;
|
|
|
|
-
|
|
|
|
/* The wait after the last probe can be shorter */
|
|
/* The wait after the last probe can be shorter */
|
|
addrconf_mod_timer(ifp, AC_RS,
|
|
addrconf_mod_timer(ifp, AC_RS,
|
|
(ifp->probes == ifp->idev->cnf.rtr_solicits) ?
|
|
(ifp->probes == ifp->idev->cnf.rtr_solicits) ?
|
|
@@ -2663,9 +2658,7 @@ static void addrconf_rs_timer(unsigned long data)
|
|
ifp->idev->cnf.rtr_solicit_interval);
|
|
ifp->idev->cnf.rtr_solicit_interval);
|
|
spin_unlock(&ifp->lock);
|
|
spin_unlock(&ifp->lock);
|
|
|
|
|
|
- ipv6_addr_all_routers(&all_routers);
|
|
|
|
-
|
|
|
|
- ndisc_send_rs(ifp->idev->dev, &ifp->addr, &all_routers);
|
|
|
|
|
|
+ ndisc_send_rs(ifp->idev->dev, &ifp->addr, &in6addr_linklocal_allrouters);
|
|
} else {
|
|
} else {
|
|
spin_unlock(&ifp->lock);
|
|
spin_unlock(&ifp->lock);
|
|
/*
|
|
/*
|
|
@@ -2806,16 +2799,12 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp)
|
|
ifp->idev->cnf.rtr_solicits > 0 &&
|
|
ifp->idev->cnf.rtr_solicits > 0 &&
|
|
(dev->flags&IFF_LOOPBACK) == 0 &&
|
|
(dev->flags&IFF_LOOPBACK) == 0 &&
|
|
(ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {
|
|
(ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {
|
|
- struct in6_addr all_routers;
|
|
|
|
-
|
|
|
|
- ipv6_addr_all_routers(&all_routers);
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* If a host as already performed a random delay
|
|
* If a host as already performed a random delay
|
|
* [...] as part of DAD [...] there is no need
|
|
* [...] as part of DAD [...] there is no need
|
|
* to delay again before sending the first RS
|
|
* to delay again before sending the first RS
|
|
*/
|
|
*/
|
|
- ndisc_send_rs(ifp->idev->dev, &ifp->addr, &all_routers);
|
|
|
|
|
|
+ ndisc_send_rs(ifp->idev->dev, &ifp->addr, &in6addr_linklocal_allrouters);
|
|
|
|
|
|
spin_lock_bh(&ifp->lock);
|
|
spin_lock_bh(&ifp->lock);
|
|
ifp->probes = 1;
|
|
ifp->probes = 1;
|