]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: the nexthop IP is displayed for FS entries. 2033/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 6 Apr 2018 11:17:16 +0000 (13:17 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 9 Apr 2018 09:04:14 +0000 (11:04 +0200)
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>
bgpd/bgp_flowspec_vty.c
bgpd/bgp_route.c

index 247da5d18347897a372a56ccbbd23ba29ba1095d..7bf11f12aa1747919f9bbee5bd0a2f91bd0946d8 100644 (file)
@@ -312,6 +312,9 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
                                json_object_array_add(json_paths,
                                                      json_ecom_path);
                }
+               if (attr->nexthop.s_addr != 0 &&
+                   display == NLRI_STRING_FORMAT_LARGE)
+                       vty_out(vty, "\tNH %-16s\n", inet_ntoa(attr->nexthop));
                XFREE(MTYPE_ECOMMUNITY_STR, s);
        }
        peer_uptime(binfo->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL);
index 944ae5b5dc7a1a7b237740127242e7d72962ec7f..bd7b9964fbdefac55375cab2fd10595d071ba5a9 100644 (file)
@@ -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();