]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: blnc cannot be NULL at if statement time
authorDonald Sharp <sharpd@nvidia.com>
Tue, 30 May 2023 23:44:36 +0000 (19:44 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 1 Jun 2023 12:58:16 +0000 (08:58 -0400)
It is impossible for the blnc statement to ever be NULL at
line 1470 as that the if statement at 1453 guarantees it
to be set to something.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_mplsvpn.c

index ecc84533b05c7dbb2dac26fd888df9f471bacbd4..dc9bd3cff525ad19a8857a131e3512216cd66673 100644 (file)
@@ -1467,13 +1467,12 @@ static mpls_label_t _vpn_leak_from_vrf_get_per_nexthop_label(
        /* Unlink from any existing nexthop cache. Free the entry if unused.
         */
        bgp_mplsvpn_path_nh_label_unlink(pi);
-       if (blnc) {
-               /* updates NHT pi list reference */
-               LIST_INSERT_HEAD(&(blnc->paths), pi, label_nh_thread);
-               pi->label_nexthop_cache = blnc;
-               pi->label_nexthop_cache->path_count++;
-               blnc->last_update = monotime(NULL);
-       }
+
+       /* updates NHT pi list reference */
+       LIST_INSERT_HEAD(&(blnc->paths), pi, label_nh_thread);
+       pi->label_nexthop_cache = blnc;
+       pi->label_nexthop_cache->path_count++;
+       blnc->last_update = monotime(NULL);
 
        /* then add or update the selected nexthop */
        if (!blnc->nh)