]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Use proper AFI when dumping information for dampening stuff
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 21 Sep 2023 13:08:50 +0000 (16:08 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 23 Sep 2023 13:52:27 +0000 (13:52 +0000)
Before we called IPv4 for IPv6 dampening info.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e0a87954848311b61e69fb957dcf0382429f15f9)

bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/bgp_route.h

index b87680326cf757a7f4a95521de85ab1819b85a30..28d3beeb6e43c8b252d1e7a83191b5faf299372f 100644 (file)
@@ -3129,7 +3129,7 @@ int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
                return CMD_WARNING;
        }
        table = bgp->rib[afi][SAFI_MPLS_VPN];
-       return bgp_show_table_rd(vty, bgp, SAFI_MPLS_VPN, table, prd, type,
+       return bgp_show_table_rd(vty, bgp, afi, SAFI_MPLS_VPN, table, prd, type,
                                 output_arg, show_flags);
 }
 
index 3d27e48185380b332cd4160b6bf13037973ea8dd..02aee9c81cafbb9030ac65c0f9d318799bfb5170 100644 (file)
@@ -11226,7 +11226,7 @@ static int bgp_show_community(struct vty *vty, struct bgp *bgp,
                              const char *comstr, int exact, afi_t afi,
                              safi_t safi, uint16_t show_flags);
 
-static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
+static int bgp_show_table(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
                          struct bgp_table *table, enum bgp_show_type type,
                          void *output_arg, const char *rd, int is_last,
                          unsigned long *output_cum, unsigned long *total_cum,
@@ -11587,12 +11587,12 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                        if (type == bgp_show_type_dampend_paths
                            || type == bgp_show_type_damp_neighbor)
                                damp_route_vty_out(vty, dest_p, pi, display,
-                                                  AFI_IP, safi, use_json,
+                                                  afi, safi, use_json,
                                                   json_paths);
                        else if (type == bgp_show_type_flap_statistics
                                 || type == bgp_show_type_flap_neighbor)
                                flap_route_vty_out(vty, dest_p, pi, display,
-                                                  AFI_IP, safi, use_json,
+                                                  afi, safi, use_json,
                                                   json_paths);
                        else {
                                if (detail_routes || detail_json) {
@@ -11748,7 +11748,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
        return CMD_SUCCESS;
 }
 
-int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
+int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
                      struct bgp_table *table, struct prefix_rd *prd_match,
                      enum bgp_show_type type, void *output_arg,
                      uint16_t show_flags)
@@ -11777,7 +11777,7 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
 
                        memcpy(&prd, dest_p, sizeof(struct prefix_rd));
                        prefix_rd2str(&prd, rd, sizeof(rd), bgp->asnotation);
-                       bgp_show_table(vty, bgp, safi, itable, type, output_arg,
+                       bgp_show_table(vty, bgp, afi, safi, itable, type, output_arg,
                                       rd, next == NULL, &output_cum,
                                       &total_cum, &json_header_depth,
                                       show_flags, RPKI_NOT_BEING_USED);
@@ -11827,7 +11827,7 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
        table = bgp->rib[afi][safi];
        /* use MPLS and ENCAP specific shows until they are merged */
        if (safi == SAFI_MPLS_VPN) {
-               return bgp_show_table_rd(vty, bgp, safi, table, NULL, type,
+               return bgp_show_table_rd(vty, bgp, afi, safi, table, NULL, type,
                                         output_arg, show_flags);
        }
 
@@ -11840,7 +11840,7 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
        if (safi == SAFI_EVPN)
                return bgp_evpn_show_all_routes(vty, bgp, type, use_json, 0);
 
-       return bgp_show_table(vty, bgp, safi, table, type, output_arg, NULL, 1,
+       return bgp_show_table(vty, bgp, afi, safi, table, type, output_arg, NULL, 1,
                              NULL, NULL, &json_header_depth, show_flags,
                              rpki_target_state);
 }
@@ -12164,7 +12164,7 @@ static void bgp_show_path_info(const struct prefix_rd *pfx_rd,
                            || CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))))
                        route_vty_out_detail(vty, bgp, bgp_node,
                                             bgp_dest_get_prefix(bgp_node), pi,
-                                            AFI_IP, safi, rpki_curr_state,
+                                            afi, safi, rpki_curr_state,
                                             json_paths);
        }
 
index 9bd9e48e22775da60de921ede5bfbba3d60c72e0..d5a00059ad2f652ec6172ab63575fcfcdc2b338d 100644 (file)
@@ -860,7 +860,7 @@ extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
                                 struct bgp_path_info *path, afi_t afi,
                                 safi_t safi, enum rpki_states,
                                 json_object *json_paths);
-extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
+extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
                             struct bgp_table *table, struct prefix_rd *prd,
                             enum bgp_show_type type, void *output_arg,
                             uint16_t show_flags);