Merge pull request #8836 from ton31337/fix/generalize_bgp_dest_locks

bgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()
This commit is contained in:
Renato Westphal 2021-06-14 10:11:17 -03:00 committed by GitHub
commit 994624c48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -205,6 +205,7 @@ void bgp_adj_in_remove(struct bgp_dest *dest, struct bgp_adj_in *bai)
{
bgp_attr_unintern(&bai->attr);
BGP_ADJ_IN_DEL(dest, bai);
bgp_dest_unlock_node(dest);
peer_unlock(bai->peer); /* adj_in peer reference */
XFREE(MTYPE_BGP_ADJ_IN, bai);
}
@ -223,10 +224,8 @@ bool bgp_adj_in_unset(struct bgp_dest *dest, struct peer *peer,
while (adj) {
adj_next = adj->next;
if (adj->peer == peer && adj->addpath_rx_id == addpath_id) {
if (adj->peer == peer && adj->addpath_rx_id == addpath_id)
bgp_adj_in_remove(dest, adj);
bgp_dest_unlock_node(dest);
}
adj = adj_next;
}

View File

@ -5048,10 +5048,8 @@ static void bgp_clear_route_table(struct peer *peer, afi_t afi, safi_t safi,
while (ain) {
ain_next = ain->next;
if (ain->peer == peer) {
if (ain->peer == peer)
bgp_adj_in_remove(dest, ain);
bgp_dest_unlock_node(dest);
}
ain = ain_next;
}
@ -5157,10 +5155,8 @@ void bgp_clear_adj_in(struct peer *peer, afi_t afi, safi_t safi)
while (ain) {
ain_next = ain->next;
if (ain->peer == peer) {
if (ain->peer == peer)
bgp_adj_in_remove(dest, ain);
bgp_dest_unlock_node(dest);
}
ain = ain_next;
}