Merge pull request #7525 from donaldsharp/dest_lock

bgpd: Fix missed unlocks
This commit is contained in:
Donatas Abraitis 2020-11-16 08:51:55 +02:00 committed by GitHub
commit 4b18f17437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View File

@ -51,6 +51,7 @@ bgp_check_rmap_prefixes_in_bgp_table(struct bgp_table *table,
if (ret != RMAP_PERMITMATCH) if (ret != RMAP_PERMITMATCH)
bgp_attr_flush(&dummy_attr); bgp_attr_flush(&dummy_attr);
else { else {
bgp_dest_unlock_node(dest);
if (BGP_DEBUG(update, UPDATE_OUT)) if (BGP_DEBUG(update, UPDATE_OUT))
zlog_debug( zlog_debug(
"%s: Condition map routes present in BGP table", "%s: Condition map routes present in BGP table",

View File

@ -2930,6 +2930,8 @@ static int install_uninstall_routes_for_vrf(struct bgp *bgp_vrf, int install)
evp, evp,
vrf_id_to_name( vrf_id_to_name(
bgp_vrf->vrf_id)); bgp_vrf->vrf_id));
bgp_dest_unlock_node(rd_dest);
bgp_dest_unlock_node(dest);
return ret; return ret;
} }
} }
@ -3009,6 +3011,9 @@ static int install_uninstall_routes_for_vni(struct bgp *bgp,
? "MACIP" ? "MACIP"
: "IMET", : "IMET",
vpn->vni); vpn->vni);
bgp_dest_unlock_node(rd_dest);
bgp_dest_unlock_node(dest);
return ret; return ret;
} }
} }

View File

@ -763,6 +763,9 @@ static int bgp_evpn_type4_remote_routes_import(struct bgp *bgp,
install ? "install" install ? "install"
: "uninstall", : "uninstall",
evp, es->esi_str); evp, es->esi_str);
bgp_dest_unlock_node(rd_dest);
bgp_dest_unlock_node(dest);
return ret; return ret;
} }
} }

View File

@ -842,8 +842,10 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
break; break;
} }
} }
if (ret == RMAP_PERMITMATCH) if (ret == RMAP_PERMITMATCH) {
bgp_dest_unlock_node(dest);
break; break;
}
} }
bgp->peer_self->rmap_type = 0; bgp->peer_self->rmap_type = 0;