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>
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);