All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] route: label externally offloaded routes
@ 2015-03-08  6:15 sfeldma
  2015-03-08  6:57 ` Jiri Pirko
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: sfeldma @ 2015-03-08  6:15 UTC (permalink / raw)
  To: netdev, stephen, jiri

From: Scott Feldman <sfeldma@gmail.com>

On ip route print dump, label externally offloaded routes with "external".
Offloaded routes are flagged with RTNH_F_EXTERNAL, a recent additon to
net-next.  For example:

$ ip route
default via 192.168.0.2 dev eth0
11.0.0.0/30 dev swp1  proto kernel  scope link  src 11.0.0.2 external
11.0.0.4/30 via 11.0.0.1 dev swp1  proto zebra  metric 20 external
11.0.0.8/30 dev swp2  proto kernel  scope link  src 11.0.0.10 external
11.0.0.12/30 via 11.0.0.9 dev swp2  proto zebra  metric 20 external
12.0.0.2  proto zebra  metric 30 external
        nexthop via 11.0.0.1  dev swp1 weight 1
        nexthop via 11.0.0.9  dev swp2 weight 1
12.0.0.3 via 11.0.0.1 dev swp1  proto zebra  metric 20 external
12.0.0.4 via 11.0.0.9 dev swp2  proto zebra  metric 20 external
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.15

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
 include/linux/rtnetlink.h |    1 +
 ip/iproute.c              |    2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 3eb7810..c74773c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -332,6 +332,7 @@ struct rtnexthop {
 #define RTNH_F_DEAD		1	/* Nexthop is dead (used by multipath)	*/
 #define RTNH_F_PERVASIVE	2	/* Do recursive gateway lookup	*/
 #define RTNH_F_ONLINK		4	/* Gateway is forced on link	*/
+#define RTNH_F_EXTERNAL		8	/* Route installed externally   */
 
 /* Macros to handle hexthops */
 
diff --git a/ip/iproute.c b/ip/iproute.c
index 76d8e36..fdb0a98 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -426,6 +426,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		fprintf(fp, "onlink ");
 	if (r->rtm_flags & RTNH_F_PERVASIVE)
 		fprintf(fp, "pervasive ");
+	if (r->rtm_flags & RTNH_F_EXTERNAL)
+		fprintf(fp, "external ");
 	if (r->rtm_flags & RTM_F_NOTIFY)
 		fprintf(fp, "notify ");
 	if (tb[RTA_MARK]) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-03-15 20:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-08  6:15 [PATCH iproute2] route: label externally offloaded routes sfeldma
2015-03-08  6:57 ` Jiri Pirko
     [not found]   ` <CAJieiUgz9O7LFhzONx5JKRv0o4+6hSHNtRgKaaKAn2ph4jdC2g@mail.gmail.com>
2015-03-08 22:10     ` Scott Feldman
2015-03-09  0:27       ` roopa
2015-03-09  6:25         ` Jiri Pirko
2015-03-08 14:14 ` roopa
2015-03-09 14:02 ` Andy Gospodarek
2015-03-09 16:16   ` Scott Feldman
2015-03-09 16:51     ` Jeff Kirsher
2015-03-09 17:53       ` John W. Linville
2015-03-15 19:39 ` Stephen Hemminger
2015-03-15 20:08   ` Scott Feldman
2015-03-15 19:41 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.