summaryrefslogtreecommitdiffstats
path: root/zebra/if_ioctl.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-03 03:05:57 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 14:01:24 +0200
commitbcc245799be7e90d912bd8d2774465fd9d407707 (patch)
tree3a8ec12a5c12e310b8a799908816db231c340785 /zebra/if_ioctl.c
parentMerge pull request #1301 from donaldsharp/zebra_vxlan (diff)
downloadfrr-bcc245799be7e90d912bd8d2774465fd9d407707.tar.xz
frr-bcc245799be7e90d912bd8d2774465fd9d407707.zip
lib: nuke the if_*_by_name_len() functions
Make use of strnlen() and strlcpy() so we can get rid of these convoluted if_*_by_name_len() functions. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/if_ioctl.c')
-rw-r--r--zebra/if_ioctl.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c
index 6396911e1..f31c24ada 100644
--- a/zebra/if_ioctl.c
+++ b/zebra/if_ioctl.c
@@ -105,10 +105,7 @@ static int interface_list_ioctl(void)
unsigned int size;
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)),
- VRF_DEFAULT, 0);
+ ifp = if_get_by_name(ifreq->ifr_name, VRF_DEFAULT, 0);
if_add_update(ifp);
size = ifreq->ifr_addr.sa_len;
if (size < sizeof(ifreq->ifr_addr))
@@ -118,10 +115,7 @@ static int interface_list_ioctl(void)
}
#else
for (n = 0; n < ifconf.ifc_len; n += sizeof(struct ifreq)) {
- ifp = if_get_by_name_len(
- ifreq->ifr_name,
- strnlen(ifreq->ifr_name, sizeof(ifreq->ifr_name)),
- VRF_DEFAULT, 0);
+ ifp = if_get_by_name(ifreq->ifr_name, VRF_DEFAULT, 0);
if_add_update(ifp);
ifreq++;
}