tst_if_name_to_index_bad - Return zero if the ifname is not a name of an interface
To check if ifname is not a name of an interface, the if_nametoindex() function shall return zero. No errors are defined.
./tst_if_name_to_index_bad [-tooloption ...] -tooloption : v6api tool option
1. The argument ifname "abc0" is not a name of an interface, should return zero 2. The argument ifname "ifname" is not a name of an interface, should return zero 3. The argument ifname "" is not a name of an interface, should return zero
The argument ifname can not be NULL. NULL ifname argument will cause program segment fault.
RFC 3493
4.1 Name-to-Index
The first function maps an interface name into its corresponding index.
#include <net/if.h>
unsigned int if_nametoindex(const char *ifname);
If ifname is the name of an interface, the if_nametoindex() function shall return the interface index corresponding to name ifname; otherwise, it shall return zero. No errors are defined.