mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:03:07 +00:00
bgpd: Clean up irt a tiny bit
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>
This commit is contained in:
parent
6e94d41057
commit
e066d6d0f2
@ -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);
|
mask_ecom_global_admin(&eval_tmp, eval);
|
||||||
|
|
||||||
irt = lookup_vrf_import_rt(&eval_tmp);
|
irt = lookup_vrf_import_rt(&eval_tmp);
|
||||||
if (irt && irt->vrfs)
|
if (irt && is_vrf_present_in_irt_vrfs(irt->vrfs, bgp_vrf))
|
||||||
if (is_vrf_present_in_irt_vrfs(irt->vrfs, bgp_vrf))
|
/* Already mapped. */
|
||||||
/* Already mapped. */
|
return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (!irt) {
|
if (!irt)
|
||||||
irt = vrf_import_rt_new(&eval_tmp);
|
irt = vrf_import_rt_new(&eval_tmp);
|
||||||
assert(irt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add VRF to the list for this RT. */
|
/* Add VRF to the list for this RT. */
|
||||||
listnode_add(irt->vrfs, bgp_vrf);
|
listnode_add(irt->vrfs, bgp_vrf);
|
||||||
|
Loading…
Reference in New Issue
Block a user