]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_flowspec_vty.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / bgpd / bgp_flowspec_vty.c
index 99d4abfff4d1e79f768a914c2322b8a79e326f8b..26f0fffb377d15ab5018bfdd5b9a9f8c02a69598 100644 (file)
@@ -315,7 +315,8 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
                }
                if (attr->nexthop.s_addr != 0 &&
                    display == NLRI_STRING_FORMAT_LARGE)
-                       vty_out(vty, "\tNH %-16s\n", inet_ntoa(attr->nexthop));
+                       vty_out(vty, "\tNLRI NH %-16s\n",
+                               inet_ntoa(attr->nexthop));
                XFREE(MTYPE_ECOMMUNITY_STR, s);
        }
        peer_uptime(path->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL);
@@ -369,7 +370,7 @@ int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi,
                            void *output_arg, bool use_json, int is_last,
                            unsigned long *output_cum, unsigned long *total_cum)
 {
-       struct bgp_path_info *ri;
+       struct bgp_path_info *pi;
        struct bgp_node *rn;
        unsigned long total_count = 0;
        json_object *json_paths = NULL;
@@ -379,18 +380,17 @@ int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi,
                return CMD_SUCCESS;
 
        for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
-               if (rn->info == NULL)
+               pi = bgp_node_get_bgp_path_info(rn);
+               if (pi == NULL)
                        continue;
                if (use_json) {
                        json_paths = json_object_new_array();
                        display = NLRI_STRING_FORMAT_JSON;
                }
-               for (ri = rn->info; ri; ri = ri->next) {
+               for (; pi; pi = pi->next) {
                        total_count++;
-                       route_vty_out_flowspec(vty, &rn->p,
-                                              ri, display,
+                       route_vty_out_flowspec(vty, &rn->p, pi, display,
                                               json_paths);
-
                }
                if (use_json) {
                        vty_out(vty, "%s\n",
@@ -544,11 +544,11 @@ extern int bgp_flowspec_display_match_per_ip(afi_t afi, struct bgp_table *rib,
                        continue;
 
                if (bgp_flowspec_contains_prefix(prefix, match, prefix_check)) {
-                       route_vty_out_flowspec(vty, &rn->p,
-                                              rn->info, use_json ?
-                                              NLRI_STRING_FORMAT_JSON :
-                                              NLRI_STRING_FORMAT_LARGE,
-                                              json_paths);
+                       route_vty_out_flowspec(
+                               vty, &rn->p, bgp_node_get_bgp_path_info(rn),
+                               use_json ? NLRI_STRING_FORMAT_JSON
+                                        : NLRI_STRING_FORMAT_LARGE,
+                               json_paths);
                        display++;
                }
        }