summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-03-11 07:34:21 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-03-15 10:41:07 -0400
commit07a112a1dc224df494490872894250fea12e8797 (patch)
treee88cdfa7b38efb00715302e03f9e67f584230610 /zebra
parent92a57eb206d51a6e9a28c9ffa1066557a18da9b2 (diff)
lib: Refactor if_get_by_name_len to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/if_ioctl.c6
-rw-r--r--zebra/if_ioctl_solaris.c2
-rw-r--r--zebra/kernel_socket.c3
3 files changed, 7 insertions, 4 deletions
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c
index 2393e0f9c5..5333f0331e 100644
--- a/zebra/if_ioctl.c
+++ b/zebra/if_ioctl.c
@@ -110,7 +110,8 @@ interface_list_ioctl (void)
ifreq = (struct ifreq *)((caddr_t) ifconf.ifc_req + n);
ifp = if_get_by_name_len(ifreq->ifr_name,
strnlen(ifreq->ifr_name,
- sizeof(ifreq->ifr_name)));
+ sizeof(ifreq->ifr_name)),
+ VRF_DEFAULT, 0);
if_add_update (ifp);
size = ifreq->ifr_addr.sa_len;
if (size < sizeof (ifreq->ifr_addr))
@@ -123,7 +124,8 @@ interface_list_ioctl (void)
{
ifp = if_get_by_name_len(ifreq->ifr_name,
strnlen(ifreq->ifr_name,
- sizeof(ifreq->ifr_name)));
+ sizeof(ifreq->ifr_name)),
+ VRF_DEFAULT, 0);
if_add_update (ifp);
ifreq++;
}
diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c
index 339e00b22c..dbc4109913 100644
--- a/zebra/if_ioctl_solaris.c
+++ b/zebra/if_ioctl_solaris.c
@@ -170,7 +170,7 @@ calculate_lifc_len: /* must hold privileges to enter here */
&& ( *(lifreq->lifr_name + normallen) != ':') )
normallen++;
- ifp = if_get_by_name_len(lifreq->lifr_name, normallen);
+ ifp = if_get_by_name_len(lifreq->lifr_name, normallen, VRF_DEFAULT, 0);
if (lifreq->lifr_addr.ss_family == AF_INET)
ifp->flags |= IFF_IPV4;
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index fee7bce1cd..7212ed6f26 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -341,7 +341,8 @@ ifan_read (struct if_announcemsghdr *ifan)
/* Create Interface */
ifp = if_get_by_name_len(ifan->ifan_name,
strnlen(ifan->ifan_name,
- sizeof(ifan->ifan_name)));
+ sizeof(ifan->ifan_name)),
+ VRF_DEFAULT, 0);
ifp->ifindex = ifan->ifan_index;
if_get_metric (ifp);