diff options
author | Donald Sharp <sharpd@nvidia.com> | 2020-11-14 21:32:49 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2020-11-14 21:32:49 +0100 |
commit | dc52beced1ef553a4f17c63859cbff0f1ea225b7 (patch) | |
tree | e8c845b5d0d0074aaa2ec38994c610abafff09a1 /bgpd/bgp_evpn.c | |
parent | Merge pull request #7474 from eololab/fix-crash-skiplist-debug (diff) | |
download | frr-dc52beced1ef553a4f17c63859cbff0f1ea225b7.tar.xz frr-dc52beced1ef553a4f17c63859cbff0f1ea225b7.zip |
bgpd: Fix missed unlocks
When iterating over the bgp_dest table, using this pattern:
for (dest = bgp_table_top(table); dest;
dest = bgp_route_next(dest)) {
If the code breaks or returns in the middle we will not have
properly unlocked the node as that bgp_table_top locks the top
dest and bgp_route_next locks the next dest and unlocks the old
dest.
From code inspection I have found a bunch of places that
we either return in the middle of or a break is issued.
Add appropriate unlocks.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r-- | bgpd/bgp_evpn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 67d0a95cb..2fae10e24 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -2930,6 +2930,8 @@ static int install_uninstall_routes_for_vrf(struct bgp *bgp_vrf, int install) evp, vrf_id_to_name( bgp_vrf->vrf_id)); + bgp_dest_unlock_node(rd_dest); + bgp_dest_unlock_node(dest); return ret; } } @@ -3009,6 +3011,9 @@ static int install_uninstall_routes_for_vni(struct bgp *bgp, ? "MACIP" : "IMET", vpn->vni); + + bgp_dest_unlock_node(rd_dest); + bgp_dest_unlock_node(dest); return ret; } } |