summaryrefslogtreecommitdiff
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-06-22 13:35:45 -0400
committerGitHub <noreply@github.com>2019-06-22 13:35:45 -0400
commita12bb225a6681b7e7eb0aac105cbc8b745675131 (patch)
treeadb8d7935dcb1da93d6cf4082f903e412e292640 /zebra/kernel_socket.c
parentefe42c51c48da8bc89df4891235fb3be0e502cf8 (diff)
parenta41c4e1b1f577443ad26222704a69649c280cd9e (diff)
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 156ce50725..be1191bac1 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -435,6 +435,7 @@ static void rtm_flag_dump(int flag)
static int ifan_read(struct if_announcemsghdr *ifan)
{
struct interface *ifp;
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
ifp = if_lookup_by_index(ifan->ifan_index, VRF_DEFAULT);
@@ -450,7 +451,7 @@ 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);
if_set_index(ifp, ifan->ifan_index);
if_get_metric(ifp);
@@ -529,6 +530,7 @@ int ifm_read(struct if_msghdr *ifm)
int maskbit;
caddr_t cp;
char fbuf[64];
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
/* terminate ifname at head (for strnlen) and tail (for safety) */
ifname[IFNAMSIZ - 1] = '\0';
@@ -614,7 +616,7 @@ int ifm_read(struct if_msghdr *ifm)
* be filled in.
*/
if ((ifp == NULL) && ifnlen)
- ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
+ ifp = if_lookup_by_name(ifname, vrf);
/*
* If ifp still does not exist or has an invalid index
@@ -643,7 +645,7 @@ int ifm_read(struct if_msghdr *ifm)
if (ifp == NULL) {
/* Interface that zebra was not previously aware of, so
* create. */
- ifp = if_create(ifname, VRF_DEFAULT);
+ ifp = if_create(ifname, vrf);
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: creating ifp for ifindex %d",
__func__, ifm->ifm_index);