diff options
Diffstat (limited to 'zebra/if_ioctl.c')
-rw-r--r-- | zebra/if_ioctl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c index 90f18e28..0d7713db 100644 --- a/zebra/if_ioctl.c +++ b/zebra/if_ioctl.c @@ -102,7 +102,9 @@ interface_list_ioctl () int size; ifreq = (struct ifreq *)((caddr_t) ifconf.ifc_req + n); - ifp = if_get_by_name (ifreq->ifr_name); + ifp = if_get_by_name_len(ifreq->ifr_name, + strnlen(ifreq->ifr_name, + sizeof(ifreq->ifr_name))); if_add_update (ifp); size = ifreq->ifr_addr.sa_len; if (size < sizeof (ifreq->ifr_addr)) @@ -113,7 +115,9 @@ interface_list_ioctl () #else for (n = 0; n < ifconf.ifc_len; n += sizeof(struct ifreq)) { - ifp = if_get_by_name (ifreq->ifr_name); + ifp = if_get_by_name_len(ifreq->ifr_name, + strnlen(ifreq->ifr_name, + sizeof(ifreq->ifr_name))); if_add_update (ifp); ifreq++; } |