mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 01:45:20 +00:00
bgpd: Handle when the import vrf has not been created.
When the `import vrf XXX` command is entered under an afi/safi for bgp and the XXX vrf bgp instance does not yet exist, auto-create it using the same ASN that the we are importing into. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
12a844a506
commit
6e2c7fe69d
@ -6601,9 +6601,17 @@ DEFPY (bgp_imexport_vrf,
|
||||
|
||||
vrf_bgp = bgp_lookup_by_name(import_name);
|
||||
if (!vrf_bgp) {
|
||||
vty_out(vty, "VRF %s is not configured as a bgp instance\n",
|
||||
import_name);
|
||||
return CMD_WARNING;
|
||||
int32_t ret;
|
||||
as_t as = bgp->as;
|
||||
|
||||
/* Auto-create assuming the same AS */
|
||||
ret = bgp_get(&vrf_bgp, &as, import_name,
|
||||
BGP_INSTANCE_TYPE_VRF);
|
||||
if (ret) {
|
||||
vty_out(vty, "VRF %s is not configured as a bgp instance\n",
|
||||
import_name);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
export_name = bgp->name ? bgp->name : VRF_DEFAULT_NAME;
|
||||
|
Loading…
Reference in New Issue
Block a user