diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-02 22:05:57 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 09:01:24 -0300 |
| commit | bcc245799be7e90d912bd8d2774465fd9d407707 (patch) | |
| tree | 3a8ec12a5c12e310b8a799908816db231c340785 /zebra/if_ioctl.c | |
| parent | e56ab0e97122d35d3f8d21faf820a90eb1953948 (diff) | |
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 6396911e1b..f31c24ada3 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++; } |
