public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: "David S. Miller" <davem@davemloft•net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6•org>
Cc: netdev@vger•kernel.org
Subject: [PATCH 12/12] IPv6: addrconf cleanup addrconf_verify
Date: Tue, 02 Mar 2010 15:32:55 -0800	[thread overview]
Message-ID: <20100302234003.694261909@vyatta.com> (raw)
In-Reply-To: 20100302233243.259794027@vyatta.com

[-- Attachment #1: addrconf-verify-clean.patch --]
[-- Type: text/plain, Size: 1403 bytes --]

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>

--- a/net/ipv6/addrconf.c	2010-03-02 14:46:44.709576675 -0800
+++ b/net/ipv6/addrconf.c	2010-03-02 14:46:46.017202416 -0800
@@ -3122,9 +3122,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;
@@ -3132,12 +3129,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);
@@ -3171,6 +3162,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))

-- 


  parent reply	other threads:[~2010-03-02 23:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 23:32 [PATCH 00/12] IPv6 addrconf changes Stephen Hemminger
2010-03-02 23:32 ` [PATCH 01/12] IPv6: addrconf dad timer unnecessary bh_disable Stephen Hemminger
2010-03-04  8:39   ` David Miller
2010-03-02 23:32 ` [PATCH 02/12] IPv6: addrconf timer race Stephen Hemminger
2010-03-04  8:40   ` David Miller
2010-03-02 23:32 ` [PATCH 03/12] IPv6: addrconf notify when address is unavailable Stephen Hemminger
2010-03-04  8:40   ` David Miller
2010-03-02 23:32 ` [PATCH 04/12] ipv6: convert temporary address list to list macros Stephen Hemminger
2010-03-02 23:32 ` [PATCH 05/12] ipv6: convert addrconf list to hlist Stephen Hemminger
2010-03-02 23:32 ` [PATCH 06/12] IPv6: convert addrconf hash list to RCU Stephen Hemminger
2010-03-02 23:32 ` [PATCH 07/12] ipv6: user better hash for addrconf Stephen Hemminger
2010-03-02 23:32 ` [PATCH 08/12] ipv6: convert idev_list to list macros Stephen Hemminger
2010-03-02 23:32 ` [PATCH 09/12] IPv6: addrconf cleanups Stephen Hemminger
2010-03-02 23:32 ` [PATCH 10/12] IPv6: addrconf checkpatch fixes Stephen Hemminger
2010-03-02 23:32 ` [PATCH 11/12] ipv6: addrconf timer changes Stephen Hemminger
2010-03-02 23:32 ` Stephen Hemminger [this message]
2010-03-03  9:16 ` [PATCH 00/12] IPv6 addrconf changes David Miller
2010-03-03 18:14   ` Stephen Hemminger
2010-03-03 18:19     ` [PATCH] IPv6: fix race between cleanup and add/delete address Stephen Hemminger
2010-03-04  8:40       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100302234003.694261909@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=yoshfuji@linux-ipv6$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox