diff options
Diffstat (limited to 'lib/if.c')
-rw-r--r-- | lib/if.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -768,7 +768,8 @@ if_nametoindex (const char *name) { struct interface *ifp; - return ((ifp = if_lookup_by_name(name)) != NULL) ? ifp->ifindex : 0; + return ((ifp = if_lookup_by_name_len(name, strnlen(name, IFNAMSIZ))) != NULL) + ? ifp->ifindex : 0; } #endif |