diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-06 13:17:16 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-09 11:04:14 +0200 |
commit | 026b914a402fd59f900fa386d8fbcfacbafb7f62 (patch) | |
tree | b37be4ebcef3cb3512932f7613df862bab168e3d /bgpd/bgp_route.c | |
parent | bgpd: handle ecom redirect-ip (diff) | |
download | frr-026b914a402fd59f900fa386d8fbcfacbafb7f62.tar.xz frr-026b914a402fd59f900fa386d8fbcfacbafb7f62.zip |
bgpd: the nexthop IP is displayed for FS entries.
Most presumably, the nexthop IP is present, only when ECOM redirect IP
is present. The nexthop is displayed.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 944ae5b5d..bd7b9964f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6545,8 +6545,20 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, } else vty_out(vty, "%-16s", inet_ntoa(attr->nexthop)); } else if (safi == SAFI_FLOWSPEC) { - /* already done */ - /* IPv4 Next Hop */ + if (attr->nexthop.s_addr != 0) { + if (json_paths) { + json_nexthop_global = json_object_new_object(); + json_object_string_add( + json_nexthop_global, "ip", + inet_ntoa(attr->nexthop)); + json_object_string_add(json_nexthop_global, + "afi", "ipv4"); + json_object_boolean_true_add(json_nexthop_global, + "used"); + } else { + vty_out(vty, "%-16s", inet_ntoa(attr->nexthop)); + } + } } else if (p->family == AF_INET && !BGP_ATTR_NEXTHOP_AFI_IP6(attr)) { if (json_paths) { json_nexthop_global = json_object_new_object(); |