From: "yasushi.asano" <yazzep@gmail.com>
To: netdev@vger.kernel.org
Cc: Yasushi Asano <yasushi.asano@jp.fujitsu.com>
Subject: [PATCH] ipv6 addrconf:fix preferred lifetime state-changing behavior while valid_lft is infinity
Date: Sun, 29 Dec 2013 16:34:01 +0900 [thread overview]
Message-ID: <1388302441-3293-1-git-send-email-yazzep@gmail.com> (raw)
In-Reply-To: <20131214091917.GB23563@order.stressinduktion.org>
From: Yasushi Asano <yasushi.asano@jp.fujitsu.com>
Signed-off-by: Yasushi Asano <yasushi.asano@jp.fujitsu.com>
---
net/ipv6/addrconf.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index cd2d7d0..796d52a 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3479,7 +3479,8 @@ restart:
&inet6_addr_lst[i], addr_lst) {
unsigned long age;
- if (ifp->flags & IFA_F_PERMANENT)
+ if ((ifp->flags & IFA_F_PERMANENT) &&
+ (ifp->prefered_lft == INFINITY_LIFE_TIME))
continue;
spin_lock(&ifp->lock);
@@ -3504,8 +3505,12 @@ restart:
ifp->flags |= IFA_F_DEPRECATED;
}
- if (time_before(ifp->tstamp + ifp->valid_lft * HZ, next))
- next = ifp->tstamp + ifp->valid_lft * HZ;
+ if (ifp->valid_lft != INFINITY_LIFE_TIME) {
+ if (time_before(ifp->tstamp +
+ ifp->valid_lft * HZ, next))
+ next = ifp->tstamp +
+ ifp->valid_lft * HZ;
+ }
spin_unlock(&ifp->lock);
@@ -3804,7 +3809,8 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
put_ifaddrmsg(nlh, ifa->prefix_len, ifa->flags, rt_scope(ifa->scope),
ifa->idev->dev->ifindex);
- if (!(ifa->flags&IFA_F_PERMANENT)) {
+ if (!((ifa->flags&IFA_F_PERMANENT) &&
+ (ifa->prefered_lft == INFINITY_LIFE_TIME))) {
preferred = ifa->prefered_lft;
valid = ifa->valid_lft;
if (preferred != INFINITY_LIFE_TIME) {
--
1.7.12.4
next prev parent reply other threads:[~2013-12-29 7:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-09 5:54 [PATCH 1/1] ipv6 addrconf:fix preferred lifetime state-changing behavior while valid_lft is infinity Asano, Yasushi
2013-12-09 23:47 ` Hannes Frederic Sowa
2013-12-12 0:58 ` Asano, Yasushi
2013-12-12 1:03 ` Hannes Frederic Sowa
2013-12-12 10:01 ` yazzep
2013-12-12 17:19 ` David Miller
2013-12-12 10:15 ` yazzep
2013-12-12 14:06 ` Sergei Shtylyov
2013-12-13 17:33 ` yazzep
2013-12-14 9:19 ` Hannes Frederic Sowa
2013-12-14 9:22 ` Hannes Frederic Sowa
2013-12-29 5:57 ` Asano, Yasushi
2013-12-29 7:34 ` yasushi.asano [this message]
2013-12-29 7:47 ` [PATCH] " yazzep
2013-12-29 15:32 ` Hannes Frederic Sowa
2013-12-30 2:17 ` Hannes Frederic Sowa
2013-12-31 3:04 ` [PATCH] ipv6 addrconf: fix " Yasushi Asano
2013-12-31 19:05 ` Hannes Frederic Sowa
2014-01-03 0:35 ` David Miller
2013-12-29 12:04 ` [PATCH 1/1] ipv6 addrconf:fix " Yasushi Asano
2013-12-12 10:46 ` Asano, Yasushi
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=1388302441-3293-1-git-send-email-yazzep@gmail.com \
--to=yazzep@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=yasushi.asano@jp.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).