Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Ensure evpn local table display shows route send status #15605

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions bgpd/bgp_evpn_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -2561,7 +2561,7 @@ static void evpn_show_route_vni_multicast(struct vty *vty, struct bgp *bgp,

/* Prefix and num paths displayed once per prefix. */
route_vty_out_detail_header(vty, bgp, dest, bgp_dest_get_prefix(dest),
NULL, afi, safi, json, false);
NULL, afi, safi, json, false, true);

/* Display each path for this prefix. */
for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
Expand Down Expand Up @@ -2663,7 +2663,7 @@ static void evpn_show_route_vni_macip(struct vty *vty, struct bgp *bgp,

/* Prefix and num paths displayed once per prefix. */
route_vty_out_detail_header(vty, bgp, dest, (struct prefix *)&p, NULL,
afi, safi, json, false);
afi, safi, json, false, true);

evp = (const struct prefix_evpn *)bgp_dest_get_prefix(dest);

Expand Down Expand Up @@ -2798,7 +2798,7 @@ static void evpn_show_route_rd_macip(struct vty *vty, struct bgp *bgp,

/* Prefix and num paths displayed once per prefix. */
route_vty_out_detail_header(vty, bgp, dest, bgp_dest_get_prefix(dest),
prd, afi, safi, json, false);
prd, afi, safi, json, false, false);

if (json)
json_paths = json_object_new_array();
Expand Down Expand Up @@ -2905,9 +2905,10 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
}

/* Prefix and num paths displayed once per prefix. */
route_vty_out_detail_header(
vty, bgp, dest, bgp_dest_get_prefix(dest), prd,
afi, safi, json_prefix, false);
route_vty_out_detail_header(vty, bgp, dest,
bgp_dest_get_prefix(dest),
prd, afi, safi, json_prefix,
false, false);

prefix_cnt++;
}
Expand Down Expand Up @@ -3042,9 +3043,10 @@ static void evpn_show_route_rd_all_macip(struct vty *vty, struct bgp *bgp,
p->prefixlen);
} else
/* Prefix and num paths displayed once per prefix. */
route_vty_out_detail_header(
vty, bgp, dest, p, (struct prefix_rd *)rd_destp,
AFI_L2VPN, SAFI_EVPN, json_prefix, false);
route_vty_out_detail_header(vty, bgp, dest, p,
(struct prefix_rd *)rd_destp,
AFI_L2VPN, SAFI_EVPN,
json_prefix, false, false);

/* For EVPN, the prefix is displayed for each path (to
* fit in with code that already exists).
Expand Down Expand Up @@ -3197,11 +3199,14 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,

/* Prefix and num paths displayed once per prefix. */
if (detail)
route_vty_out_detail_header(
vty, bgp, dest,
bgp_dest_get_prefix(dest),
(struct prefix_rd *)rd_destp, AFI_L2VPN,
SAFI_EVPN, json_prefix, false);
route_vty_out_detail_header(vty, bgp, dest,
bgp_dest_get_prefix(
dest),
(struct prefix_rd *)
rd_destp,
AFI_L2VPN, SAFI_EVPN,
json_prefix, false,
false);

/* For EVPN, the prefix is displayed for each path (to
* fit in
Expand Down
35 changes: 21 additions & 14 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -11918,10 +11918,9 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t sa
if (!use_json)
route_vty_out_detail_header(
vty, bgp, dest,
bgp_dest_get_prefix(
dest),
bgp_dest_get_prefix(dest),
prd, table->afi, safi,
NULL, false);
NULL, false, false);

route_vty_out_detail(
vty, bgp, dest, dest_p, pi,
Expand Down Expand Up @@ -11994,10 +11993,12 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t sa

prd = bgp_rd_from_dest(dest, safi);

route_vty_out_detail_header(
vty, bgp, dest,
bgp_dest_get_prefix(dest), prd,
table->afi, safi, json_paths, true);
route_vty_out_detail_header(vty, bgp, dest,
bgp_dest_get_prefix(
dest),
prd, table->afi,
safi, json_paths,
true, false);

vty_out(vty, "\"paths\": ");
json_detail_header_used = true;
Expand Down Expand Up @@ -12203,7 +12204,7 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
struct bgp_dest *dest, const struct prefix *p,
const struct prefix_rd *prd, afi_t afi,
safi_t safi, json_object *json,
bool incremental_print)
bool incremental_print, bool local_table)
{
struct bgp_path_info *pi;
struct peer *peer;
Expand Down Expand Up @@ -12421,8 +12422,14 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
json_object_object_add(json, "advertisedTo",
json_adv_to);
} else {
if (!json && first)
vty_out(vty, " Not advertised to any peer");
if (!json && first) {
if (!local_table)
vty_out(vty,
" Not advertised to any peer");
else
vty_out(vty,
" Local BGP table not advertised");
}
vty_out(vty, "\n");
}
}
Expand Down Expand Up @@ -12461,10 +12468,10 @@ static void bgp_show_path_info(const struct prefix_rd *pfx_rd,
}

if (header) {
route_vty_out_detail_header(
vty, bgp, bgp_node,
bgp_dest_get_prefix(bgp_node), pfx_rd, AFI_IP,
safi, json_header, false);
route_vty_out_detail_header(vty, bgp, bgp_node,
bgp_dest_get_prefix(bgp_node),
pfx_rd, AFI_IP, safi,
json_header, false, false);
header = 0;
}
(*display)++;
Expand Down
3 changes: 2 additions & 1 deletion bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
const struct prefix *p,
const struct prefix_rd *prd, afi_t afi,
safi_t safi, json_object *json,
bool incremental_print);
bool incremental_print,
bool local_table);
extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
struct bgp_dest *bn, const struct prefix *p,
struct bgp_path_info *path, afi_t afi,
Expand Down
Loading