From patchwork Fri Apr 5 09:39:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 234088 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 1AA3F2C00B5 for ; Fri, 5 Apr 2013 20:39:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161098Ab3DEJjt (ORCPT ); Fri, 5 Apr 2013 05:39:49 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:50181 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751763Ab3DEJjs (ORCPT ); Fri, 5 Apr 2013 05:39:48 -0400 Received: by mail-wi0-f178.google.com with SMTP id ez12so381660wid.11 for ; Fri, 05 Apr 2013 02:39:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=eX5HS6PP4mVcifM8M2ZMo5zSH6O9aTqBFBBffzW4VH0=; b=TWUtvinB+2gpO5NGz5K0S8JyT9M1Fl+kgpyL00+nyu+86ogsx0+Pur2vndqGMAvVlz oCmDiy1nprDU9rOSoOZiSaFGP0QyLOCwmY+3UpfxNrxjcy7LqduAkIiiIfjIPSGYnRxD Bqkn4D6VlA2DAoolWvGc0BhwjvILtOGB22/YJiaskW4boKg8pEd3iXxYwbdELF1bJzTq fRIBTJeSZ5Kx8wKC5b7B+qFYjR3Xg6qkM7GbNu5hQMAkNPUnwyVTy9BlXh6/CnbTzneG EuA8CV23UCCmRkQ3k9qfj2UQ6SG08FzDtHeFeOkSgQYqL5oxnT83OqhHB3z3RcnD6Y96 JsKw== X-Received: by 10.194.178.100 with SMTP id cx4mr15050400wjc.47.1365154785989; Fri, 05 Apr 2013 02:39:45 -0700 (PDT) Received: from localhost (ip-89-103-91-114.net.upcbroadband.cz. [89.103.91.114]) by mx.google.com with ESMTPS id er1sm2524890wib.5.2013.04.05.02.39.44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Apr 2013 02:39:45 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net Subject: [patch net 1/2] net: ipv4: reset check_lifetime_work after changing lifetime Date: Fri, 5 Apr 2013 11:39:38 +0200 Message-Id: <1365154779-4204-2-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1365154779-4204-1-git-send-email-jiri@resnulli.us> References: <1365154779-4204-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQl5VIhdbIYEKxZYFJLMaXMxoSz6WZZ8oxotjvjEWHabYNvJF6nZlm0ANv4V2HniGemBAkxS Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This will result in calling check_lifetime in nearest opportunity and that function will adjust next time to call check_lifetime correctly. Without this, check_lifetime is called in time computed by previous run, not affecting modified lifetime. Introduced by: commit 5c766d642bcaf "ipv4: introduce address lifetime" Signed-off-by: Jiri Pirko --- net/ipv4/devinet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 96083b7..00386e0 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -804,6 +804,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg return -EEXIST; ifa = ifa_existing; set_ifa_lifetime(ifa, valid_lft, prefered_lft); + cancel_delayed_work(&check_lifetime_work); + schedule_delayed_work(&check_lifetime_work, 0); rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid); blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa); }