summaryrefslogtreecommitdiff
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-10-19 16:46:58 -0400
committerGitHub <noreply@github.com>2021-10-19 16:46:58 -0400
commit32c8a3c2ae48d85bd855b0ebb55c426121be843a (patch)
tree2b489718f0d61ed4c5b043959bcbe3e18035d874 /zebra/kernel_socket.c
parente9f7b2b597ad8c6947ce3b7238e89391e4f9f863 (diff)
parentf60a11883cb426f574dbe5abeff8254148e7c371 (diff)
Merge pull request #9818 from idryzhov/lib-if-fixes
lib: allow to create interfaces in non-existing VRFs
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index d9c69ceb6d..2db3e6e904 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -443,7 +443,8 @@ static int ifan_read(struct if_announcemsghdr *ifan)
__func__, ifan->ifan_index, ifan->ifan_name);
/* Create Interface */
- ifp = if_get_by_name(ifan->ifan_name, VRF_DEFAULT);
+ ifp = if_get_by_name(ifan->ifan_name, VRF_DEFAULT,
+ VRF_DEFAULT_NAME);
if_set_index(ifp, ifan->ifan_index);
if_get_metric(ifp);
@@ -624,7 +625,8 @@ int ifm_read(struct if_msghdr *ifm)
if (ifp == NULL) {
/* Interface that zebra was not previously aware of, so
* create. */
- ifp = if_create_name(ifname, VRF_DEFAULT);
+ ifp = if_get_by_name(ifname, VRF_DEFAULT,
+ VRF_DEFAULT_NAME);
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: creating ifp for ifindex %d",
__func__, ifm->ifm_index);