]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Sat, 2 Apr 2005 23:05:56 +0000 (23:05 +0000)
committerajs <ajs>
Sat, 2 Apr 2005 23:05:56 +0000 (23:05 +0000)
* 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.

lib/ChangeLog
lib/if.c

index 35910a6553fc77560f77ed96a71a000d22609c46..f55578e6d7e47b0f29d2bdad5a945b71e4070573 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * if.h: (if_lookup_by_name_len, if_get_by_name_len) New functions.
index 212b236c1e63f244d0b15ce503d4b9acf3541f49..a32cee0e5b30a9d9997c53f7db0b1c35ea65ad28 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -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