summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-13 14:06:38 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-19 14:29:51 +0200
commitf60a11883cb426f574dbe5abeff8254148e7c371 (patch)
tree2b489718f0d61ed4c5b043959bcbe3e18035d874 /ospfd/ospf_vty.c
parentMerge pull request #9730 from AnuradhaKaruppiah/evpn-recv-lttng (diff)
downloadfrr-f60a11883cb426f574dbe5abeff8254148e7c371.tar.xz
frr-f60a11883cb426f574dbe5abeff8254148e7c371.zip
lib: allow to create interfaces in non-existing VRFs
It allows FRR to read the interface config even when the necessary VRFs are not yet created and interfaces are in "wrong" VRFs. Currently, such config is rejected. For VRF-lite backend, we don't care at all about the VRF of the inactive interface. When the interface is created in the OS and becomes active, we always use its actual VRF instead of the configured one. So there's no need to reject the config. For netns backend, we may have multiple interfaces with the same name in different VRFs. So we care about the VRF of inactive interfaces. And we must allow to preconfigure the interface in a VRF even before it is moved to the corresponding netns. From now on, we allow to create multiple configs for the same interface name in different VRFs and the necessary config is applied once the OS interface is moved to the corresponding netns. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 9863a1011..64d3b7a02 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -445,7 +445,7 @@ DEFUN_HIDDEN (ospf_passive_interface_addr,
"Please, use \"ip ospf passive\" on an interface instead.\n");
if (ospf->vrf_id != VRF_UNKNOWN)
- ifp = if_get_by_name(argv[1]->arg, ospf->vrf_id);
+ ifp = if_get_by_name(argv[1]->arg, ospf->vrf_id, ospf->name);
if (ifp == NULL) {
vty_out(vty, "interface %s not found.\n", (char *)argv[1]->arg);
@@ -506,7 +506,7 @@ DEFUN_HIDDEN (no_ospf_passive_interface,
"Please, use \"no ip ospf passive\" on an interface instead.\n");
if (ospf->vrf_id != VRF_UNKNOWN)
- ifp = if_get_by_name(argv[2]->arg, ospf->vrf_id);
+ ifp = if_get_by_name(argv[2]->arg, ospf->vrf_id, ospf->name);
if (ifp == NULL) {
vty_out(vty, "interface %s not found.\n", (char *)argv[2]->arg);