mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-12 11:41:41 +00:00
Merge pull request #15326 from pguibert6WIND/bgp_flowspec_ipv6_flush
bgpd: fix flushing ipv6 flowspec entries when peering stops
This commit is contained in:
commit
04d0834464
@ -3520,7 +3520,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
|
|||||||
*/
|
*/
|
||||||
if (old_select &&
|
if (old_select &&
|
||||||
is_route_parent_evpn(old_select))
|
is_route_parent_evpn(old_select))
|
||||||
bgp_zebra_withdraw(p, old_select, bgp, safi);
|
bgp_zebra_withdraw(p, old_select, bgp, afi,
|
||||||
|
safi);
|
||||||
|
|
||||||
bgp_zebra_announce(dest, p, new_select, bgp, afi, safi);
|
bgp_zebra_announce(dest, p, new_select, bgp, afi, safi);
|
||||||
} else {
|
} else {
|
||||||
@ -3530,7 +3531,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
|
|||||||
|| old_select->sub_type == BGP_ROUTE_AGGREGATE
|
|| old_select->sub_type == BGP_ROUTE_AGGREGATE
|
||||||
|| old_select->sub_type == BGP_ROUTE_IMPORTED))
|
|| old_select->sub_type == BGP_ROUTE_IMPORTED))
|
||||||
|
|
||||||
bgp_zebra_withdraw(p, old_select, bgp, safi);
|
bgp_zebra_withdraw(p, old_select, bgp, afi,
|
||||||
|
safi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4427,7 +4429,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
if (pi && pi->attr->rmap_table_id != new_attr.rmap_table_id) {
|
if (pi && pi->attr->rmap_table_id != new_attr.rmap_table_id) {
|
||||||
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
|
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
|
||||||
/* remove from RIB previous entry */
|
/* remove from RIB previous entry */
|
||||||
bgp_zebra_withdraw(p, pi, bgp, safi);
|
bgp_zebra_withdraw(p, pi, bgp, afi, safi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peer->sort == BGP_PEER_EBGP) {
|
if (peer->sort == BGP_PEER_EBGP) {
|
||||||
@ -6029,7 +6031,7 @@ bool bgp_inbound_policy_exists(struct peer *peer, struct bgp_filter *filter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
|
static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
|
||||||
safi_t safi)
|
afi_t afi, safi_t safi)
|
||||||
{
|
{
|
||||||
struct bgp_dest *dest;
|
struct bgp_dest *dest;
|
||||||
struct bgp_path_info *pi;
|
struct bgp_path_info *pi;
|
||||||
@ -6053,7 +6055,8 @@ static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
|
|||||||
|| pi->sub_type == BGP_ROUTE_IMPORTED)) {
|
|| pi->sub_type == BGP_ROUTE_IMPORTED)) {
|
||||||
|
|
||||||
if (bgp_fibupd_safi(safi))
|
if (bgp_fibupd_safi(safi))
|
||||||
bgp_zebra_withdraw(p, pi, bgp, safi);
|
bgp_zebra_withdraw(p, pi, bgp, afi,
|
||||||
|
safi);
|
||||||
}
|
}
|
||||||
|
|
||||||
dest = bgp_path_info_reap(dest, pi);
|
dest = bgp_path_info_reap(dest, pi);
|
||||||
@ -6071,7 +6074,7 @@ void bgp_cleanup_routes(struct bgp *bgp)
|
|||||||
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
|
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
|
||||||
if (afi == AFI_L2VPN)
|
if (afi == AFI_L2VPN)
|
||||||
continue;
|
continue;
|
||||||
bgp_cleanup_table(bgp, bgp->rib[afi][SAFI_UNICAST],
|
bgp_cleanup_table(bgp, bgp->rib[afi][SAFI_UNICAST], afi,
|
||||||
SAFI_UNICAST);
|
SAFI_UNICAST);
|
||||||
/*
|
/*
|
||||||
* VPN and ENCAP and EVPN tables are two-level (RD is top level)
|
* VPN and ENCAP and EVPN tables are two-level (RD is top level)
|
||||||
@ -6083,7 +6086,7 @@ void bgp_cleanup_routes(struct bgp *bgp)
|
|||||||
dest = bgp_route_next(dest)) {
|
dest = bgp_route_next(dest)) {
|
||||||
table = bgp_dest_get_bgp_table_info(dest);
|
table = bgp_dest_get_bgp_table_info(dest);
|
||||||
if (table != NULL) {
|
if (table != NULL) {
|
||||||
bgp_cleanup_table(bgp, table, safi);
|
bgp_cleanup_table(bgp, table, afi, safi);
|
||||||
bgp_table_finish(&table);
|
bgp_table_finish(&table);
|
||||||
bgp_dest_set_bgp_table_info(dest, NULL);
|
bgp_dest_set_bgp_table_info(dest, NULL);
|
||||||
dest = bgp_dest_unlock_node(dest);
|
dest = bgp_dest_unlock_node(dest);
|
||||||
@ -6096,7 +6099,7 @@ void bgp_cleanup_routes(struct bgp *bgp)
|
|||||||
dest = bgp_route_next(dest)) {
|
dest = bgp_route_next(dest)) {
|
||||||
table = bgp_dest_get_bgp_table_info(dest);
|
table = bgp_dest_get_bgp_table_info(dest);
|
||||||
if (table != NULL) {
|
if (table != NULL) {
|
||||||
bgp_cleanup_table(bgp, table, safi);
|
bgp_cleanup_table(bgp, table, afi, safi);
|
||||||
bgp_table_finish(&table);
|
bgp_table_finish(&table);
|
||||||
bgp_dest_set_bgp_table_info(dest, NULL);
|
bgp_dest_set_bgp_table_info(dest, NULL);
|
||||||
dest = bgp_dest_unlock_node(dest);
|
dest = bgp_dest_unlock_node(dest);
|
||||||
@ -6110,7 +6113,7 @@ void bgp_cleanup_routes(struct bgp *bgp)
|
|||||||
dest = bgp_route_next(dest)) {
|
dest = bgp_route_next(dest)) {
|
||||||
table = bgp_dest_get_bgp_table_info(dest);
|
table = bgp_dest_get_bgp_table_info(dest);
|
||||||
if (table != NULL) {
|
if (table != NULL) {
|
||||||
bgp_cleanup_table(bgp, table, SAFI_EVPN);
|
bgp_cleanup_table(bgp, table, afi, SAFI_EVPN);
|
||||||
bgp_table_finish(&table);
|
bgp_table_finish(&table);
|
||||||
bgp_dest_set_bgp_table_info(dest, NULL);
|
bgp_dest_set_bgp_table_info(dest, NULL);
|
||||||
dest = bgp_dest_unlock_node(dest);
|
dest = bgp_dest_unlock_node(dest);
|
||||||
|
@ -1724,7 +1724,7 @@ void bgp_zebra_announce_table_all_subtypes(struct bgp *bgp, afi_t afi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void bgp_zebra_withdraw(const struct prefix *p, struct bgp_path_info *info,
|
void bgp_zebra_withdraw(const struct prefix *p, struct bgp_path_info *info,
|
||||||
struct bgp *bgp, safi_t safi)
|
struct bgp *bgp, afi_t afi, safi_t safi)
|
||||||
{
|
{
|
||||||
struct zapi_route api;
|
struct zapi_route api;
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
@ -1743,7 +1743,7 @@ void bgp_zebra_withdraw(const struct prefix *p, struct bgp_path_info *info,
|
|||||||
|
|
||||||
if (safi == SAFI_FLOWSPEC) {
|
if (safi == SAFI_FLOWSPEC) {
|
||||||
peer = info->peer;
|
peer = info->peer;
|
||||||
bgp_pbr_update_entry(peer->bgp, p, info, AFI_IP, safi, false);
|
bgp_pbr_update_entry(peer->bgp, p, info, afi, safi, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1784,7 +1784,7 @@ void bgp_zebra_withdraw_table_all_subtypes(struct bgp *bgp, afi_t afi, safi_t sa
|
|||||||
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
|
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
|
||||||
&& (pi->type == ZEBRA_ROUTE_BGP))
|
&& (pi->type == ZEBRA_ROUTE_BGP))
|
||||||
bgp_zebra_withdraw(bgp_dest_get_prefix(dest),
|
bgp_zebra_withdraw(bgp_dest_get_prefix(dest),
|
||||||
pi, bgp, safi);
|
pi, bgp, afi, safi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ extern void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
|
|||||||
extern void bgp_zebra_announce_table(struct bgp *bgp, afi_t afi, safi_t safi);
|
extern void bgp_zebra_announce_table(struct bgp *bgp, afi_t afi, safi_t safi);
|
||||||
extern void bgp_zebra_withdraw(const struct prefix *p,
|
extern void bgp_zebra_withdraw(const struct prefix *p,
|
||||||
struct bgp_path_info *path, struct bgp *bgp,
|
struct bgp_path_info *path, struct bgp *bgp,
|
||||||
safi_t safi);
|
afi_t afi, safi_t safi);
|
||||||
|
|
||||||
/* Announce routes of any bgp subtype of a table to zebra */
|
/* Announce routes of any bgp subtype of a table to zebra */
|
||||||
extern void bgp_zebra_announce_table_all_subtypes(struct bgp *bgp, afi_t afi,
|
extern void bgp_zebra_announce_table_all_subtypes(struct bgp *bgp, afi_t afi,
|
||||||
|
Loading…
Reference in New Issue
Block a user