Commit 655444bd authored by Scott Feldman's avatar Scott Feldman Committed by Stephen Hemminger

route: label externally offloaded routes

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: default avatarScott Feldman <sfeldma@gmail.com>
Reviewed-by: default avatarJiri Pirko <jiri@resnulli.us>
parent 61333d24
...@@ -412,6 +412,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) ...@@ -412,6 +412,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf(fp, "onlink "); fprintf(fp, "onlink ");
if (r->rtm_flags & RTNH_F_PERVASIVE) if (r->rtm_flags & RTNH_F_PERVASIVE)
fprintf(fp, "pervasive "); fprintf(fp, "pervasive ");
if (r->rtm_flags & RTNH_F_EXTERNAL)
fprintf(fp, "external ");
if (r->rtm_flags & RTM_F_NOTIFY) if (r->rtm_flags & RTM_F_NOTIFY)
fprintf(fp, "notify "); fprintf(fp, "notify ");
if (tb[RTA_MARK]) { if (tb[RTA_MARK]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment