]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: don't unlock bgp_dest twice
authorTrey Aspelund <taspelund@nvidia.com>
Mon, 11 Jul 2022 22:17:39 +0000 (18:17 -0400)
committerStephen Worley <sworley@nvidia.com>
Tue, 11 Oct 2022 20:18:21 +0000 (16:18 -0400)
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>
bgpd/bgp_evpn.c

index 6d402a4feff823415c344d328f3dbe54448b5b1e..90e04a042d2837eab227e2e74c98383bb36cd7a4 100644 (file)
@@ -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);