|
|
049c96 |
From fcb76a6f2bd281e956dc736fb63dc1fa238ce220 Mon Sep 17 00:00:00 2001
|
|
|
049c96 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
049c96 |
Date: Wed, 20 Jul 2016 20:48:14 +0200
|
|
|
049c96 |
Subject: [PATCH] ip route: timeout for routes has to be set in seconds
|
|
|
049c96 |
|
|
|
049c96 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1357020
|
|
|
049c96 |
Upstream Status: iproute2.git commit eecc006952d6f
|
|
|
049c96 |
Conflicts: Changed context due to missing commit f638e9f7c8718
|
|
|
049c96 |
("mpls: always set type RTN_UNICAST and scope
|
|
|
049c96 |
RT_SCOPE_UNIVERSE for")
|
|
|
049c96 |
|
|
|
049c96 |
commit eecc006952d6f3992b632974d0f04f995d2a176e
|
|
|
049c96 |
Author: Andrew Vagin <avagin@virtuozzo.com>
|
|
|
049c96 |
Date: Wed Jun 29 02:27:14 2016 +0300
|
|
|
049c96 |
|
|
|
049c96 |
ip route: timeout for routes has to be set in seconds
|
|
|
049c96 |
|
|
|
049c96 |
Currently a timeout is multiplied by HZ in user-space and
|
|
|
049c96 |
then it multiplied by HZ in kernel-space.
|
|
|
049c96 |
|
|
|
049c96 |
$ ./ip/ip r add 2002::0/64 dev veth1 expires 10
|
|
|
049c96 |
$ ./ip/ip -6 r
|
|
|
049c96 |
2002::/64 dev veth1 metric 1024 linkdown expires 996sec pref medium
|
|
|
049c96 |
|
|
|
049c96 |
Cc: Xin Long <lucien.xin@gmail.com>
|
|
|
049c96 |
Cc: Hangbin Liu <liuhangbin@gmail.com>
|
|
|
049c96 |
Cc: Stephen Hemminger <shemming@brocade.com>
|
|
|
049c96 |
Fixes: 68eede250500 ("route: allow routes to be configured with expire values")
|
|
|
049c96 |
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
|
|
|
049c96 |
---
|
|
|
049c96 |
ip/iproute.c | 5 +----
|
|
|
049c96 |
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
|
049c96 |
|
|
|
049c96 |
diff --git a/ip/iproute.c b/ip/iproute.c
|
|
|
049c96 |
index a13e6f3..094566a 100644
|
|
|
049c96 |
--- a/ip/iproute.c
|
|
|
049c96 |
+++ b/ip/iproute.c
|
|
|
049c96 |
@@ -747,7 +747,6 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
|
|
|
049c96 |
int scope_ok = 0;
|
|
|
049c96 |
int table_ok = 0;
|
|
|
049c96 |
int raw = 0;
|
|
|
049c96 |
- static int hz;
|
|
|
049c96 |
|
|
|
049c96 |
memset(&req, 0, sizeof(req));
|
|
|
049c96 |
|
|
|
049c96 |
@@ -804,9 +803,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
|
|
|
049c96 |
NEXT_ARG();
|
|
|
049c96 |
if (get_u32(&expires, *argv, 0))
|
|
|
049c96 |
invarg("\"expires\" value is invalid\n", *argv);
|
|
|
049c96 |
- if (!hz)
|
|
|
049c96 |
- hz = get_user_hz();
|
|
|
049c96 |
- addattr32(&req.n, sizeof(req), RTA_EXPIRES, expires*hz);
|
|
|
049c96 |
+ addattr32(&req.n, sizeof(req), RTA_EXPIRES, expires);
|
|
|
049c96 |
} else if (matches(*argv, "metric") == 0 ||
|
|
|
049c96 |
matches(*argv, "priority") == 0 ||
|
|
|
049c96 |
matches(*argv, "preference") == 0) {
|
|
|
049c96 |
--
|
|
|
049c96 |
1.8.3.1
|
|
|
049c96 |
|