Skip to content

Commit

Permalink
bgpd: fix table-map option
Browse files Browse the repository at this point in the history
Schedule zebra to withdraw routes filtered out by a table-map.

Signed-off-by: Alexander Skorichenko <[email protected]>
  • Loading branch information
askorichenko committed Jan 23, 2025
1 parent 3d7dbcf commit 8f58246
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,9 +1679,24 @@ void bgp_zebra_announce_table(struct bgp *bgp, afi_t afi, safi_t safi)
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED) &&
(pi->type == ZEBRA_ROUTE_BGP
&& (pi->sub_type == BGP_ROUTE_NORMAL
|| pi->sub_type == BGP_ROUTE_IMPORTED)))
bgp_zebra_route_install(dest, pi, bgp, true,
|| pi->sub_type == BGP_ROUTE_IMPORTED))) {
bool is_add = true;

if (bgp->table_map[afi][safi].name) {
struct attr local_attr = *pi->attr;
struct bgp_path_info local_info = *pi;

local_info.attr = &local_attr;

is_add = bgp_table_map_apply(
bgp->table_map[afi][safi].map,
bgp_dest_get_prefix(dest),
&local_info);
}

bgp_zebra_route_install(dest, pi, bgp, is_add,
NULL, false);
}
}

/* Announce routes of any bgp subtype of a table to zebra */
Expand Down

0 comments on commit 8f58246

Please sign in to comment.