diff options
| author | ajs <ajs> | 2005-04-02 23:05:56 +0000 | 
|---|---|---|
| committer | ajs <ajs> | 2005-04-02 23:05:56 +0000 | 
| commit | 018546e9656b141eeecdf59f627fcdc9b7381840 (patch) | |
| tree | dda8f27fcde00ae6c7ab080224f97b9c9a29dabe | |
| parent | a349198fd3e4e5692cdc91223f8153cb53c086ce (diff) | |
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.
| -rw-r--r-- | lib/ChangeLog | 6 | ||||
| -rw-r--r-- | lib/if.c | 3 | 
2 files changed, 8 insertions, 1 deletions
| diff --git a/lib/ChangeLog b/lib/ChangeLog index 35910a65..f55578e6 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,11 @@  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.  	* if.c: (if_lookup_by_name_len, if_get_by_name_len) New functions.  	  (if_get_by_name) Tighten up code. @@ -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 | 
