|
@@ -186,7 +186,8 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
|
|
|
|
|
|
static void addrconf_dad_start(struct inet6_ifaddr *ifp);
|
|
static void addrconf_dad_start(struct inet6_ifaddr *ifp);
|
|
static void addrconf_dad_work(struct work_struct *w);
|
|
static void addrconf_dad_work(struct work_struct *w);
|
|
-static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id);
|
|
|
|
|
|
+static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id,
|
|
|
|
+ bool send_na);
|
|
static void addrconf_dad_run(struct inet6_dev *idev);
|
|
static void addrconf_dad_run(struct inet6_dev *idev);
|
|
static void addrconf_rs_timer(struct timer_list *t);
|
|
static void addrconf_rs_timer(struct timer_list *t);
|
|
static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);
|
|
static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);
|
|
@@ -3838,12 +3839,17 @@ static void addrconf_dad_begin(struct inet6_ifaddr *ifp)
|
|
idev->cnf.accept_dad < 1) ||
|
|
idev->cnf.accept_dad < 1) ||
|
|
!(ifp->flags&IFA_F_TENTATIVE) ||
|
|
!(ifp->flags&IFA_F_TENTATIVE) ||
|
|
ifp->flags & IFA_F_NODAD) {
|
|
ifp->flags & IFA_F_NODAD) {
|
|
|
|
+ bool send_na = false;
|
|
|
|
+
|
|
|
|
+ if (ifp->flags & IFA_F_TENTATIVE &&
|
|
|
|
+ !(ifp->flags & IFA_F_OPTIMISTIC))
|
|
|
|
+ send_na = true;
|
|
bump_id = ifp->flags & IFA_F_TENTATIVE;
|
|
bump_id = ifp->flags & IFA_F_TENTATIVE;
|
|
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
|
|
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
|
|
spin_unlock(&ifp->lock);
|
|
spin_unlock(&ifp->lock);
|
|
read_unlock_bh(&idev->lock);
|
|
read_unlock_bh(&idev->lock);
|
|
|
|
|
|
- addrconf_dad_completed(ifp, bump_id);
|
|
|
|
|
|
+ addrconf_dad_completed(ifp, bump_id, send_na);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3972,16 +3978,21 @@ static void addrconf_dad_work(struct work_struct *w)
|
|
}
|
|
}
|
|
|
|
|
|
if (ifp->dad_probes == 0) {
|
|
if (ifp->dad_probes == 0) {
|
|
|
|
+ bool send_na = false;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* DAD was successful
|
|
* DAD was successful
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+ if (ifp->flags & IFA_F_TENTATIVE &&
|
|
|
|
+ !(ifp->flags & IFA_F_OPTIMISTIC))
|
|
|
|
+ send_na = true;
|
|
bump_id = ifp->flags & IFA_F_TENTATIVE;
|
|
bump_id = ifp->flags & IFA_F_TENTATIVE;
|
|
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
|
|
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
|
|
spin_unlock(&ifp->lock);
|
|
spin_unlock(&ifp->lock);
|
|
write_unlock_bh(&idev->lock);
|
|
write_unlock_bh(&idev->lock);
|
|
|
|
|
|
- addrconf_dad_completed(ifp, bump_id);
|
|
|
|
|
|
+ addrconf_dad_completed(ifp, bump_id, send_na);
|
|
|
|
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -4019,7 +4030,8 @@ static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id)
|
|
|
|
|
|
+static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id,
|
|
|
|
+ bool send_na)
|
|
{
|
|
{
|
|
struct net_device *dev = ifp->idev->dev;
|
|
struct net_device *dev = ifp->idev->dev;
|
|
struct in6_addr lladdr;
|
|
struct in6_addr lladdr;
|
|
@@ -4051,6 +4063,16 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id)
|
|
if (send_mld)
|
|
if (send_mld)
|
|
ipv6_mc_dad_complete(ifp->idev);
|
|
ipv6_mc_dad_complete(ifp->idev);
|
|
|
|
|
|
|
|
+ /* send unsolicited NA if enabled */
|
|
|
|
+ if (send_na &&
|
|
|
|
+ (ifp->idev->cnf.ndisc_notify ||
|
|
|
|
+ dev_net(dev)->ipv6.devconf_all->ndisc_notify)) {
|
|
|
|
+ ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifp->addr,
|
|
|
|
+ /*router=*/ !!ifp->idev->cnf.forwarding,
|
|
|
|
+ /*solicited=*/ false, /*override=*/ true,
|
|
|
|
+ /*inc_opt=*/ true);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (send_rs) {
|
|
if (send_rs) {
|
|
/*
|
|
/*
|
|
* If a host as already performed a random delay
|
|
* If a host as already performed a random delay
|