]> git.proxmox.com Git - mirror_frr.git/commit
lib: allow to create interfaces in non-existing VRFs
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 13 Oct 2021 12:06:38 +0000 (15:06 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 19 Oct 2021 12:29:51 +0000 (15:29 +0300)
commitf60a11883cb426f574dbe5abeff8254148e7c371
tree2b489718f0d61ed4c5b043959bcbe3e18035d874
parente9f7b2b597ad8c6947ce3b7238e89391e4f9f863
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>
12 files changed:
lib/if.c
lib/if.h
lib/vrf.c
lib/zclient.c
ospf6d/ospf6_top.c
ospfd/ospf_interface.c
ospfd/ospf_vty.c
pimd/pim_iface.c
zebra/if_ioctl.c
zebra/if_netlink.c
zebra/interface.c
zebra/kernel_socket.c