]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Clean up irt a tiny bit
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 23:19:54 +0000 (19:19 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 23:19:54 +0000 (19:19 -0400)
This commit does these 2 things:

1) irt->vrfs is never NULL so no need to test for it

2) No need to check for a good irt value returned from
vrf_import_rt_new as that the alloc operation will
dump if memory allocation fails.

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

index b3d6f388b9f92933f39ff935451bd6e4083fb8cb..a03b067344e5b912ecba079102cf44003b6d39f2 100644 (file)
@@ -367,15 +367,12 @@ static void map_vrf_to_rt(struct bgp *bgp_vrf, struct ecommunity_val *eval)
                mask_ecom_global_admin(&eval_tmp, eval);
 
        irt = lookup_vrf_import_rt(&eval_tmp);
-       if (irt && irt->vrfs)
-               if (is_vrf_present_in_irt_vrfs(irt->vrfs, bgp_vrf))
-                       /* Already mapped. */
-                       return;
+       if (irt && is_vrf_present_in_irt_vrfs(irt->vrfs, bgp_vrf))
+               /* Already mapped. */
+               return;
 
-       if (!irt) {
+       if (!irt)
                irt = vrf_import_rt_new(&eval_tmp);
-               assert(irt);
-       }
 
        /* Add VRF to the list for this RT. */
        listnode_add(irt->vrfs, bgp_vrf);