diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-03 03:05:57 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 14:01:24 +0200 |
commit | bcc245799be7e90d912bd8d2774465fd9d407707 (patch) | |
tree | 3a8ec12a5c12e310b8a799908816db231c340785 /zebra/if_ioctl.c | |
parent | Merge pull request #1301 from donaldsharp/zebra_vxlan (diff) | |
download | frr-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.c | 10 |
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++; } |