summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-02-11 13:48:12 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-02-11 13:48:12 +0100
commitb0b97a7f6103202884311ae52c7bac202c83d24e (patch)
tree1b8887a86c56fb232fb52468c93ec9939ad72332 /lib
parentlib: interface handling where zebra not yet ready (diff)
downloadfrr-b0b97a7f6103202884311ae52c7bac202c83d24e.tar.xz
frr-b0b97a7f6103202884311ae52c7bac202c83d24e.zip
lib: handling vrf backend unknown case
on interface search algorithm, at initialisation, when reading config file, the vrf backend may not be yet known ( because zebra did not sync yet with daemon). For that, avoid searching interface name in a separate vrf. This change of behaviour is induced because the assumption is done that at config startup, the user is not wrong with the interface configuration to use. Every usage of vrf_get_backend() should then be wisely adapted in order to handle that init state. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index 6ae75939e..910a38d4c 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -397,6 +397,7 @@ struct interface *if_get_by_name(const char *name, vrf_id_t vrf_id)
struct interface *ifp;
switch (vrf_get_backend()) {
+ case VRF_BACKEND_UNKNOWN:
case VRF_BACKEND_NETNS:
ifp = if_lookup_by_name(name, vrf_id);
if (ifp)
@@ -1282,6 +1283,10 @@ static int lib_interface_create(enum nb_event event,
return NB_ERR_VALIDATION;
}
+ /* if VRF is netns or not yet known - init for instance
+ * then assumption is that passed config is exact
+ * then the user intent was not to use an other iface
+ */
if (vrf_get_backend() == VRF_BACKEND_VRF_LITE) {
ifp = if_lookup_by_name_all_vrf(ifname);
if (ifp && ifp->vrf_id != vrf->vrf_id) {