IPv6: addrconf cleanup addrconf_verify
authorstephen hemminger <shemminger@vyatta.com>
Wed, 17 Mar 2010 20:31:17 +0000 (20:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 20 Mar 2010 23:09:11 +0000 (16:09 -0700)
The variable regen_advance is only used in the privacy case.
Move it to simplify code and eliminate ifdef's

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index 279580eab30984e5fc71c58f23e1939248ab5989..36ebb4ad8a0a1f956f8b3c57bec81643d62a1814 100644 (file)
@@ -3124,9 +3124,6 @@ restart:
                hlist_for_each_entry_rcu(ifp, node,
                                         &inet6_addr_lst[i], addr_lst) {
                        unsigned long age;
-#ifdef CONFIG_IPV6_PRIVACY
-                       unsigned long regen_advance;
-#endif
 
                        if (ifp->flags & IFA_F_PERMANENT)
                                continue;
@@ -3134,12 +3131,6 @@ restart:
                        spin_lock(&ifp->lock);
                        age = (now - ifp->tstamp) / HZ;
 
-#ifdef CONFIG_IPV6_PRIVACY
-                       regen_advance = ifp->idev->cnf.regen_max_retry *
-                                       ifp->idev->cnf.dad_transmits *
-                                       ifp->idev->nd_parms->retrans_time / HZ;
-#endif
-
                        if (ifp->valid_lft != INFINITY_LIFE_TIME &&
                            age >= ifp->valid_lft) {
                                spin_unlock(&ifp->lock);
@@ -3173,6 +3164,10 @@ restart:
 #ifdef CONFIG_IPV6_PRIVACY
                        } else if ((ifp->flags&IFA_F_TEMPORARY) &&
                                   !(ifp->flags&IFA_F_TENTATIVE)) {
+                               unsigned long regen_advance = ifp->idev->cnf.regen_max_retry *
+                                       ifp->idev->cnf.dad_transmits *
+                                       ifp->idev->nd_parms->retrans_time / HZ;
+
                                if (age >= ifp->prefered_lft - regen_advance) {
                                        struct inet6_ifaddr *ifpub = ifp->ifpub;
                                        if (time_before(ifp->tstamp + ifp->prefered_lft * HZ, next))