diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-13 15:06:38 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-19 15:29:51 +0300 |
| commit | f60a11883cb426f574dbe5abeff8254148e7c371 (patch) | |
| tree | 2b489718f0d61ed4c5b043959bcbe3e18035d874 /ospf6d/ospf6_top.c | |
| parent | e9f7b2b597ad8c6947ce3b7238e89391e4f9f863 (diff) | |
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 'ospf6d/ospf6_top.c')
| -rw-r--r-- | ospf6d/ospf6_top.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 9e3bb4895a..7e9ed4160d 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -1032,7 +1032,6 @@ DEFUN_HIDDEN (ospf6_interface_area, struct ospf6_area *oa; struct ospf6_interface *oi; struct interface *ifp; - vrf_id_t vrf_id = VRF_DEFAULT; uint32_t area_id; int format; @@ -1041,11 +1040,8 @@ DEFUN_HIDDEN (ospf6_interface_area, vty_out(vty, "Please, use \"ipv6 ospf6 area\" on an interface instead.\n"); - if (ospf6->vrf_id != VRF_UNKNOWN) - vrf_id = ospf6->vrf_id; - /* find/create ospf6 interface */ - ifp = if_get_by_name(argv[idx_ifname]->arg, vrf_id); + ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name); oi = (struct ospf6_interface *)ifp->info; if (oi == NULL) oi = ospf6_interface_create(ifp); @@ -1107,18 +1103,14 @@ DEFUN_HIDDEN (no_ospf6_interface_area, struct ospf6_area *oa; struct interface *ifp; uint32_t area_id; - vrf_id_t vrf_id = VRF_DEFAULT; vty_out(vty, "This command is deprecated, because it is not VRF-aware.\n"); vty_out(vty, "Please, use \"no ipv6 ospf6 area\" on an interface instead.\n"); - if (ospf6->vrf_id != VRF_UNKNOWN) - vrf_id = ospf6->vrf_id; - /* find/create ospf6 interface */ - ifp = if_get_by_name(argv[idx_ifname]->arg, vrf_id); + ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name); if (ifp == NULL) { vty_out(vty, "No such interface %s\n", argv[idx_ifname]->arg); |
