]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_updgrp_adv.c
bgpd: Fix missed unlocks
authorDonald Sharp <sharpd@nvidia.com>
Sat, 14 Nov 2020 20:32:49 +0000 (15:32 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Sat, 14 Nov 2020 20:32:49 +0000 (15:32 -0500)
commitdc52beced1ef553a4f17c63859cbff0f1ea225b7
treee8c845b5d0d0074aaa2ec38994c610abafff09a1
parent15675d025dc024733a532e1a9ad19c59df4ba73d
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>
bgpd/bgp_conditional_adv.c
bgpd/bgp_evpn.c
bgpd/bgp_evpn_mh.c
bgpd/bgp_updgrp_adv.c