diff options
author | ajs <ajs> | 2005-04-03 01:05:56 +0200 |
---|---|---|
committer | ajs <ajs> | 2005-04-03 01:05:56 +0200 |
commit | 018546e9656b141eeecdf59f627fcdc9b7381840 (patch) | |
tree | dda8f27fcde00ae6c7ab080224f97b9c9a29dabe /lib/if.c | |
parent | 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff) | |
download | frr-018546e9656b141eeecdf59f627fcdc9b7381840.tar.xz frr-018546e9656b141eeecdf59f627fcdc9b7381840.zip |
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if.c: (if_nametoindex) The man page is rather vague, but it seems
like the argument to if_nametoindex has an implicit maximum length
of IFNAMSIZ characters.
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 |