diff mbox

[net-next] ipv6: remove old token ipv6 address as soon as possible

Message ID 20130624200328.GJ13836@order.stressinduktion.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Hannes Frederic Sowa June 24, 2013, 8:03 p.m. UTC
If the tokenized ip address is re-set on an interface we depend on the
arrival of a new router advertisment to call addrconf_verify to clean
up the old address (which valid_lft is now set to 0). Old addresses can
linger around for a longer time if e.g. the source of router advertisments
vanishes.

So, call addrconf_verify immediately after setting the new tokenized
address to get rid of the old tokenized addresses.

Cc: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/addrconf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Borkmann June 25, 2013, 7:56 a.m. UTC | #1
On 06/24/2013 10:03 PM, Hannes Frederic Sowa wrote:
> If the tokenized ip address is re-set on an interface we depend on the
> arrival of a new router advertisment to call addrconf_verify to clean
> up the old address (which valid_lft is now set to 0). Old addresses can
> linger around for a longer time if e.g. the source of router advertisments
> vanishes.
>
> So, call addrconf_verify immediately after setting the new tokenized
> address to get rid of the old tokenized addresses.
>
> Cc: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Agreed. This is also done when simply adding or modifying an address, so this
would be good for tokenized addresses, too. I've tested it also and it looks
good. Thanks Hannes !

Acked-by: Daniel Borkmann <dborkman@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 25, 2013, 11:30 p.m. UTC | #2
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Mon, 24 Jun 2013 22:03:28 +0200

> If the tokenized ip address is re-set on an interface we depend on the
> arrival of a new router advertisment to call addrconf_verify to clean
> up the old address (which valid_lft is now set to 0). Old addresses can
> linger around for a longer time if e.g. the source of router advertisments
> vanishes.
> 
> So, call addrconf_verify immediately after setting the new tokenized
> address to get rid of the old tokenized addresses.
> 
> Cc: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 90788a1..ffc280f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4363,6 +4363,7 @@  static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token)
 	}
 
 	write_unlock_bh(&idev->lock);
+	addrconf_verify(0);
 	return 0;
 }