From patchwork Tue Jun 28 23:27:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Vagin X-Patchwork-Id: 641771 X-Patchwork-Delegate: shemminger@vyatta.com 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 3rfMRK1LbPz9snl for ; Wed, 29 Jun 2016 09:27:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=g3jHFmQn; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752450AbcF1X1e (ORCPT ); Tue, 28 Jun 2016 19:27:34 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33954 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbcF1X1d (ORCPT ); Tue, 28 Jun 2016 19:27:33 -0400 Received: by mail-pa0-f66.google.com with SMTP id us13so2812611pab.1 for ; Tue, 28 Jun 2016 16:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=ZfXXKEJQDwDImDfdEiwIOzf/b9ePQ/6KEBUFwytul7I=; b=g3jHFmQnWvYZQ+QyyFZj0s7B4GWNcjvXioj7WslQ74xkMmBFusSh1lNgVf1pK1bDOy 3SWEBJsYK7a+Fvp1OsTwOmxuMUZVZRFqYr9BnySEWFdzmIzoa7rfB9RtDjfWwL3uwKN4 tQme3xO+9OPcS1sK3lMzYGGaE9FLnghte4wzk3j7oGJmPNiI0xzNKOrtcfWnjPa9wqga d8uyl3+OFyoZnSccZe6JQzObAS2SpoGnXv8Cdwk0gikPuxbNsVo4IURPZw+fUeYl2puN LX04SqK9f6oTx/B3Ybp/AlZnmJfF7FX9UAPWQurS9oR5y1FDIQyntIPlyXklqZ/+dMM1 dIqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=ZfXXKEJQDwDImDfdEiwIOzf/b9ePQ/6KEBUFwytul7I=; b=K2XLQh3VEgt/aTnU9VjOWvWE749BsTxt/i+BW3A7vIoJe+M98np5s7TtkwXGO3THWo TMeQ52q4NfrRQkXBuDv2QDsqKdGakkOrVKiwqc1Dg8MiJEu1GFC9Hrv0mn7vTI7m9gT4 nzX5obXHGEsVTu4PRTmUKDFJ7vHz9dyqd1U65IEk4lmohWf1ZFrgGkyahkz+CJCAOV3b amj+jIo5IleATD4CCKg6KVl+8LGsqXcunGAWsep7/NpjCI3WtgPpWpkmG12oAoiJ9kML TrotTzLLDOg1A7+AwExeihOvwe1Hyb1S2iST99eibOsAa4PTgEmJHdcoz7SfXsgeyE59 awuw== X-Gm-Message-State: ALyK8tKpjqhcA5HusV4FMGjW3WVO88OHY9HGEZTb5mTv65y4ZO1aYW+9pMDBvhCjUBrYYA== X-Received: by 10.67.4.137 with SMTP id ce9mr6443886pad.120.1467156440205; Tue, 28 Jun 2016 16:27:20 -0700 (PDT) Received: from fc22-vm.localdomain ([162.246.95.100]) by smtp.gmail.com with ESMTPSA id 20sm538290pfw.92.2016.06.28.16.27.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2016 16:27:19 -0700 (PDT) From: Andrey Vagin To: netdev@vger.kernel.org Cc: Andrew Vagin , Xin Long , Hangbin Liu , Stephen Hemminger Subject: [PATCH] ip route: timeout for routes has to be set in seconds Date: Wed, 29 Jun 2016 02:27:14 +0300 Message-Id: <1467156434-2157-1-git-send-email-avagin@openvz.org> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Andrew Vagin Currently a timeout is multiplied by HZ in user-space and then it multiplied by HZ in kernel-space. $ ./ip/ip r add 2002::0/64 dev veth1 expires 10 $ ./ip/ip -6 r 2002::/64 dev veth1 metric 1024 linkdown expires 996sec pref medium Cc: Xin Long Cc: Hangbin Liu Cc: Stephen Hemminger Fixes: 68eede250500 ("route: allow routes to be configured with expire values") Signed-off-by: Andrew Vagin --- ip/iproute.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ip/iproute.c b/ip/iproute.c index 8224d7f..7c0f5a4 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -839,7 +839,6 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) int table_ok = 0; int raw = 0; int type_ok = 0; - static int hz; memset(&req, 0, sizeof(req)); @@ -923,9 +922,7 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) NEXT_ARG(); if (get_u32(&expires, *argv, 0)) invarg("\"expires\" value is invalid\n", *argv); - if (!hz) - hz = get_user_hz(); - addattr32(&req.n, sizeof(req), RTA_EXPIRES, expires*hz); + addattr32(&req.n, sizeof(req), RTA_EXPIRES, expires); } else if (matches(*argv, "metric") == 0 || matches(*argv, "priority") == 0 || strcmp(*argv, "preference") == 0) {