[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080402.084114.60517414.yoshfuji@linux-ipv6.org>
Date: Wed, 02 Apr 2008 08:41:14 +0900 (JST)
From: YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@...ux-ipv6.org>
To: benoit.boissinot@...-lyon.org
Cc: netdev@...r.kernel.org, pekkas@...core.fi, yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH 4 of 5] IPv6: fix lifetime calculation on temporary
address creation
In article <20080401215657.GP475@...zuine> (at Tue, 1 Apr 2008 23:56:57 +0200), Benoit Boissinot <benoit.boissinot@...-lyon.org> says:
> On Fri, Mar 28, 2008 at 12:04:01PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> > In article <ec551b4a5bb25cda00ff.1206305172@...zuine> (at Sun, 23 Mar 2008 21:46:12 +0100), Benoit Boissinot <benoit.boissinot@...-lyon.org> says:
> >
> > > IPv6: fix lifetime calculation on temporary address creation
> [snip]
> > > + now = jiffies;
> > > + elapsed = (now - ifp->tstamp) / HZ;
> > > + if (elapsed >= ifp->valid_lft)
> > > + tmp_valid_lft = 0;
> > > + else
> > > + tmp_valid_lft = min_t(__u32,
> > > + ifp->valid_lft - elapsed,
> > > + idev->cnf.temp_valid_lft);
> > > + if (elapsed >= ifp->prefered_lft)
> > > + tmp_prefered_lft = 0;
> > > + else
> > > + tmp_prefered_lft = min_t(__u32,
> > > + ifp->prefered_lft - elapsed,
> > > + idev->cnf.temp_prefered_lft - desync_factor / HZ);
> >
> > Basically I agree, but it is possible to expire the temporary
> > address AFTER public address, which is not good. Please fix this.
>
> do you mean because of the rounding of 'elapsed' ? otherwise I don't see
> what the problem is, sorry.
Right. Maybe we could substruct "now" by adj = (now - ifp->tstamp) % HZ;
now = jiffies
elapsed = (now - ifp->tstamp) / HZ;
now -= (now - ifp->tstamp) % HZ;
--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists