summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrey Aspelund <taspelund@nvidia.com>2022-07-12 00:17:39 +0200
committerStephen Worley <sworley@nvidia.com>2022-10-11 22:18:21 +0200
commitb5118501acea0d571bbc90a077f90a29a3e6a93d (patch)
tree9ac0b00937a59a54d52f5ba98ebf25f4f88a595c
parentbgpd: add show bgp vni <VNI|all> json commands (diff)
downloadfrr-b5118501acea0d571bbc90a077f90a29a3e6a93d.tar.xz
frr-b5118501acea0d571bbc90a077f90a29a3e6a93d.zip
bgpd: don't unlock bgp_dest twice
Both install_evpn_route_entry_in_vni_mac() and install_evpn_route_entry_in_vni_ip() will unlock the bgp_dest when install_evpn_route_entry_in_vni_common() returns, so there's no need to unlock the bgp_dest inside the _common function. Let's let the new wrappers handle the cleanup of the dest. Ticket: #3119673 Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
-rw-r--r--bgpd/bgp_evpn.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 6d402a4fe..90e04a042 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -2906,11 +2906,15 @@ static int install_evpn_route_entry_in_vni_common(
new_local_es = bgp_evpn_attr_is_local_es(pi->attr);
} else {
- if (attrhash_cmp(pi->attr, parent_pi->attr)
- && !CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)) {
- bgp_dest_unlock_node(dest);
+ /* Return early if attributes haven't changed
+ * and dest isn't flagged for removal.
+ * dest will be unlocked by either
+ * install_evpn_route_entry_in_vni_mac() or
+ * install_evpn_route_entry_in_vni_ip()
+ */
+ if (attrhash_cmp(pi->attr, parent_pi->attr) &&
+ !CHECK_FLAG(pi->flags, BGP_PATH_REMOVED))
return 0;
- }
/* The attribute has changed. */
/* Add (or update) attribute to hash. */
attr_new = bgp_attr_intern(parent_pi->attr);