From patchwork Mon Jun 24 20:03:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Frederic Sowa X-Patchwork-Id: 253952 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4B4062C0091 for ; Tue, 25 Jun 2013 06:03:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751013Ab3FXUDa (ORCPT ); Mon, 24 Jun 2013 16:03:30 -0400 Received: from order.stressinduktion.org ([87.106.68.36]:35097 "EHLO order.stressinduktion.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775Ab3FXUD3 (ORCPT ); Mon, 24 Jun 2013 16:03:29 -0400 Received: by order.stressinduktion.org (Postfix, from userid 500) id 9EA881A0C588; Mon, 24 Jun 2013 22:03:28 +0200 (CEST) Date: Mon, 24 Jun 2013 22:03:28 +0200 From: Hannes Frederic Sowa To: netdev@vger.kernel.org Cc: dborkman@redhat.com Subject: [PATCH net-next] ipv6: remove old token ipv6 address as soon as possible Message-ID: <20130624200328.GJ13836@order.stressinduktion.org> Mail-Followup-To: netdev@vger.kernel.org, dborkman@redhat.com Mime-Version: 1.0 Content-Disposition: inline Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Hannes Frederic Sowa Acked-by: Daniel Borkmann --- net/ipv6/addrconf.c | 1 + 1 file changed, 1 insertion(+) 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; }