* Bug 71591 - Temporary address re-generated when it should not (public address about to expire)
@ 2014-03-06 16:29 Heiner Kallweit
0 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2014-03-06 16:29 UTC (permalink / raw)
To: netdev
Recently I faced the issue that a public address was about to expire and
3s before expiry a new temporary address was generated which instantly
went into deprecated state.
This didn't do any harm however it's wrong IMHO. Problem seems to be in
function ipv6_create_tempaddr in addrconf.c.
A new temporary address is generated if this condition is met:
tmp_prefered_lft > regen_advance
tmp_prefered_lft however is an offset from tstamp, not from now.
This condition only checks that the new address is preferred until more
than regen_advance from tstamp,
but it should check that the new address is preferred until more than
regen_advance from now.
I submitted this issue to kernel bugzilla -> 71591
Hannes asked me to propose a patch, here it comes.
Rgds, Heiner
diff -uNr linux-3.10.32.vanilla/net/ipv6/addrconf.c
linux-3.10.32.patched/net/ipv6/addrconf.c
--- linux-3.10.32.vanilla/net/ipv6/addrconf.c 2014-02-22
14:41:54.000000000 -0600
+++ linux-3.10.32.patched/net/ipv6/addrconf.c 2014-03-06
17:07:12.953699438 -0600
@@ -1111,8 +1111,9 @@
* Lifetime is greater than REGEN_ADVANCE time units. In particular,
* an implementation must not create a temporary address with a zero
* Preferred Lifetime.
+ * Note that tmp_prefered_lft is relative to ifp->tstamp not now.
*/
- if (tmp_prefered_lft <= regen_advance) {
+ if (tmp_prefered_lft <= regen_advance + age) {
in6_ifa_put(ifp);
in6_dev_put(idev);
ret = -1;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Bug 71591 - Temporary address re-generated when it should not (public address about to expire)
@ 2014-03-06 16:38 Heiner Kallweit
2014-03-06 16:43 ` Hannes Frederic Sowa
0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2014-03-06 16:38 UTC (permalink / raw)
To: netdev
Recently I faced the issue that a public address was about to expire and
3s before expiry a new temporary address was generated which instantly
went into deprecated state.
This didn't do any harm however it's wrong IMHO. Problem seems to be in
function ipv6_create_tempaddr in addrconf.c.
A new temporary address is generated if this condition is met:
tmp_prefered_lft > regen_advance
tmp_prefered_lft however is an offset from tstamp, not from now.
This condition only checks that the new address is preferred until more
than regen_advance from tstamp,
but it should check that the new address is preferred until more than
regen_advance from now.
I submitted this issue to kernel bugzilla -> 71591
Hannes asked me to propose a patch, here it comes.
Rgds, Heiner
diff -uNr linux-3.10.32.vanilla/net/ipv6/addrconf.c
linux-3.10.32.patched/net/ipv6/addrconf.c
--- linux-3.10.32.vanilla/net/ipv6/addrconf.c 2014-02-22
14:41:54.000000000 -0600
+++ linux-3.10.32.patched/net/ipv6/addrconf.c 2014-03-06
17:07:12.953699438 -0600
@@ -1111,8 +1111,9 @@
* Lifetime is greater than REGEN_ADVANCE time units. In particular,
* an implementation must not create a temporary address with a zero
* Preferred Lifetime.
+ * Note that tmp_prefered_lft is relative to ifp->tstamp not now.
*/
- if (tmp_prefered_lft <= regen_advance) {
+ if (tmp_prefered_lft <= regen_advance + age) {
in6_ifa_put(ifp);
in6_dev_put(idev);
ret = -1;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Bug 71591 - Temporary address re-generated when it should not (public address about to expire)
@ 2014-03-06 16:41 Heiner Kallweit
0 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2014-03-06 16:41 UTC (permalink / raw)
To: netdev
Recently I faced the issue that a public address was about to expire and
3s before expiry a new temporary address was generated which instantly
went into deprecated state.
This didn't do any harm however it's wrong IMHO. Problem seems to be in
function ipv6_create_tempaddr in addrconf.c.
A new temporary address is generated if this condition is met:
tmp_prefered_lft > regen_advance
tmp_prefered_lft however is an offset from tstamp, not from now.
This condition only checks that the new address is preferred until more
than regen_advance from tstamp,
but it should check that the new address is preferred until more than
regen_advance from now.
I submitted this issue to kernel bugzilla -> 71591
Hannes asked me to propose a patch, here it comes.
Rgds, Heiner
diff -uNr linux-3.10.32.vanilla/net/ipv6/addrconf.c
linux-3.10.32.patched/net/ipv6/addrconf.c
--- linux-3.10.32.vanilla/net/ipv6/addrconf.c 2014-02-22
14:41:54.000000000 -0600
+++ linux-3.10.32.patched/net/ipv6/addrconf.c 2014-03-06
17:07:12.953699438 -0600
@@ -1111,8 +1111,9 @@
* Lifetime is greater than REGEN_ADVANCE time units. In particular,
* an implementation must not create a temporary address with a zero
* Preferred Lifetime.
+ * Note that tmp_prefered_lft is relative to ifp->tstamp not now.
*/
- if (tmp_prefered_lft <= regen_advance) {
+ if (tmp_prefered_lft <= regen_advance + age) {
in6_ifa_put(ifp);
in6_dev_put(idev);
ret = -1;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug 71591 - Temporary address re-generated when it should not (public address about to expire)
2014-03-06 16:38 Heiner Kallweit
@ 2014-03-06 16:43 ` Hannes Frederic Sowa
2014-03-06 17:02 ` Heiner Kallweit
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2014-03-06 16:43 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: netdev
On Thu, Mar 06, 2014 at 05:38:21PM +0100, Heiner Kallweit wrote:
> Recently I faced the issue that a public address was about to expire and
> 3s before expiry a new temporary address was generated which instantly
> went into deprecated state.
> This didn't do any harm however it's wrong IMHO. Problem seems to be in
> function ipv6_create_tempaddr in addrconf.c.
> A new temporary address is generated if this condition is met:
> tmp_prefered_lft > regen_advance
> tmp_prefered_lft however is an offset from tstamp, not from now.
> This condition only checks that the new address is preferred until more
> than regen_advance from tstamp,
> but it should check that the new address is preferred until more than
> regen_advance from now.
>
> I submitted this issue to kernel bugzilla -> 71591
> Hannes asked me to propose a patch, here it comes.
You would need to follow Documentation/SubmittingPatches and provide a proper
signed-off-by.
Basically if scripts/checkpatch.pl --strict doesn't complain on your patch any
more, then you're ready to submit.
Otherwise the patch looks good to me.
Thanks,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug 71591 - Temporary address re-generated when it should not (public address about to expire)
2014-03-06 16:43 ` Hannes Frederic Sowa
@ 2014-03-06 17:02 ` Heiner Kallweit
0 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2014-03-06 17:02 UTC (permalink / raw)
To: netdev
Thanks for the hint on the correct procedure. Next try ..
Output from checkpatch.p --strict
total: 0 errors, 0 warnings, 0 checks, 10 lines checked
patch-3.10.32-ipv6_create_tempaddr has no obvious style problems and is
ready for submission.
diff -upNr linux-3.10.32.vanilla/net/ipv6/addrconf.c
linux-3.10.32.patched/net/ipv6/addrconf.c
--- linux-3.10.32.vanilla/net/ipv6/addrconf.c 2014-02-22
14:41:54.000000000 -0600
+++ linux-3.10.32.patched/net/ipv6/addrconf.c 2014-03-06
17:07:12.953699438 -0600
@@ -1111,8 +1111,9 @@ retry:
* Lifetime is greater than REGEN_ADVANCE time units. In particular,
* an implementation must not create a temporary address with a zero
* Preferred Lifetime.
+ * Note that tmp_prefered_lft is relative to ifp->tstamp not now.
*/
- if (tmp_prefered_lft <= regen_advance) {
+ if (tmp_prefered_lft <= regen_advance + age) {
in6_ifa_put(ifp);
in6_dev_put(idev);
ret = -1;
Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
Rgds,
Heiner
Am 06.03.2014 17:43, schrieb Hannes Frederic Sowa:
> On Thu, Mar 06, 2014 at 05:38:21PM +0100, Heiner Kallweit wrote:
>> Recently I faced the issue that a public address was about to expire and
>> 3s before expiry a new temporary address was generated which instantly
>> went into deprecated state.
>> This didn't do any harm however it's wrong IMHO. Problem seems to be in
>> function ipv6_create_tempaddr in addrconf.c.
>> A new temporary address is generated if this condition is met:
>> tmp_prefered_lft > regen_advance
>> tmp_prefered_lft however is an offset from tstamp, not from now.
>> This condition only checks that the new address is preferred until more
>> than regen_advance from tstamp,
>> but it should check that the new address is preferred until more than
>> regen_advance from now.
>>
>> I submitted this issue to kernel bugzilla -> 71591
>> Hannes asked me to propose a patch, here it comes.
> You would need to follow Documentation/SubmittingPatches and provide a proper
> signed-off-by.
>
> Basically if scripts/checkpatch.pl --strict doesn't complain on your patch any
> more, then you're ready to submit.
>
> Otherwise the patch looks good to me.
>
> Thanks,
>
> Hannes
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-06 17:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 16:29 Bug 71591 - Temporary address re-generated when it should not (public address about to expire) Heiner Kallweit
-- strict thread matches above, loose matches on Subject: below --
2014-03-06 16:38 Heiner Kallweit
2014-03-06 16:43 ` Hannes Frederic Sowa
2014-03-06 17:02 ` Heiner Kallweit
2014-03-06 16:41 Heiner Kallweit
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).