|
|
4aca6e |
From 002cfe8913c88232569f316c7446834f985d52ff Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Phil Sutter <psutter@redhat.com>
|
|
|
4aca6e |
Date: Tue, 28 Feb 2017 16:10:39 +0100
|
|
|
4aca6e |
Subject: [PATCH] route: label externally offloaded routes
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
|
|
|
4aca6e |
Upstream Status: iproute2.git commit 655444bdadfcf
|
|
|
4aca6e |
|
|
|
4aca6e |
commit 655444bdadfcf348d4e668476f493e542587446b
|
|
|
4aca6e |
Author: Scott Feldman <sfeldma@gmail.com>
|
|
|
4aca6e |
Date: Sat Mar 7 22:15:35 2015 -0800
|
|
|
4aca6e |
|
|
|
4aca6e |
route: label externally offloaded routes
|
|
|
4aca6e |
|
|
|
4aca6e |
On ip route print dump, label externally offloaded routes with "external".
|
|
|
4aca6e |
Offloaded routes are flagged with RTNH_F_EXTERNAL, a recent additon to
|
|
|
4aca6e |
net-next. For example:
|
|
|
4aca6e |
|
|
|
4aca6e |
$ ip route
|
|
|
4aca6e |
default via 192.168.0.2 dev eth0
|
|
|
4aca6e |
11.0.0.0/30 dev swp1 proto kernel scope link src 11.0.0.2 external
|
|
|
4aca6e |
11.0.0.4/30 via 11.0.0.1 dev swp1 proto zebra metric 20 external
|
|
|
4aca6e |
11.0.0.8/30 dev swp2 proto kernel scope link src 11.0.0.10 external
|
|
|
4aca6e |
11.0.0.12/30 via 11.0.0.9 dev swp2 proto zebra metric 20 external
|
|
|
4aca6e |
12.0.0.2 proto zebra metric 30 external
|
|
|
4aca6e |
nexthop via 11.0.0.1 dev swp1 weight 1
|
|
|
4aca6e |
nexthop via 11.0.0.9 dev swp2 weight 1
|
|
|
4aca6e |
12.0.0.3 via 11.0.0.1 dev swp1 proto zebra metric 20 external
|
|
|
4aca6e |
12.0.0.4 via 11.0.0.9 dev swp2 proto zebra metric 20 external
|
|
|
4aca6e |
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.15
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
|
|
|
4aca6e |
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
|
|
|
4aca6e |
---
|
|
|
4aca6e |
ip/iproute.c | 2 ++
|
|
|
4aca6e |
1 file changed, 2 insertions(+)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/ip/iproute.c b/ip/iproute.c
|
|
|
4aca6e |
index 9dcfd19..6d64469 100644
|
|
|
4aca6e |
--- a/ip/iproute.c
|
|
|
4aca6e |
+++ b/ip/iproute.c
|
|
|
4aca6e |
@@ -438,6 +438,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
|
|
4aca6e |
fprintf(fp, "onlink ");
|
|
|
4aca6e |
if (r->rtm_flags & RTNH_F_PERVASIVE)
|
|
|
4aca6e |
fprintf(fp, "pervasive ");
|
|
|
4aca6e |
+ if (r->rtm_flags & RTNH_F_EXTERNAL)
|
|
|
4aca6e |
+ fprintf(fp, "external ");
|
|
|
4aca6e |
if (r->rtm_flags & RTM_F_NOTIFY)
|
|
|
4aca6e |
fprintf(fp, "notify ");
|
|
|
4aca6e |
if (tb[RTA_MARK]) {
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|