mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 21:06:01 +00:00
bgpd: Lock originating bgp pointer for vrf route leaking
There exists cases where we will attempt to hard delete the bgp instance( say a `no router bgp` is issued ) when we have vrf route leaking. If we do have this lock the bgp instance of the originator and do not let it be deleted out from under us until we are finished processing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
122eebd85a
commit
21d88ef761
@ -573,7 +573,7 @@ leak_update(
|
||||
new->extra->parent = bgp_info_lock(parent);
|
||||
bgp_lock_node((struct bgp_node *)((struct bgp_info *)parent)->net);
|
||||
if (bgp_orig)
|
||||
new->extra->bgp_orig = bgp_orig;
|
||||
new->extra->bgp_orig = bgp_lock(bgp_orig);
|
||||
if (nexthop_orig)
|
||||
new->extra->nexthop_orig = *nexthop_orig;
|
||||
|
||||
|
@ -206,11 +206,19 @@ struct bgp_info *bgp_info_new(void)
|
||||
static void bgp_info_free(struct bgp_info *binfo)
|
||||
{
|
||||
/* unlink reference to parent, if any. */
|
||||
if (binfo->extra && binfo->extra->parent) {
|
||||
bgp_unlock_node((struct bgp_node *)((struct bgp_info *)binfo
|
||||
->extra->parent)->net);
|
||||
bgp_info_unlock((struct bgp_info *)binfo->extra->parent);
|
||||
binfo->extra->parent = NULL;
|
||||
if (binfo->extra) {
|
||||
if (binfo->extra->parent) {
|
||||
bgp_unlock_node(
|
||||
(struct bgp_node *)((struct bgp_info *)binfo
|
||||
->extra->parent)
|
||||
->net);
|
||||
bgp_info_unlock(
|
||||
(struct bgp_info *)binfo->extra->parent);
|
||||
binfo->extra->parent = NULL;
|
||||
}
|
||||
|
||||
if (binfo->extra->bgp_orig)
|
||||
bgp_unlock(binfo->extra->bgp_orig);
|
||||
}
|
||||
|
||||
if (binfo->attr)
|
||||
|
Loading…
Reference in New Issue
Block a user