The attached patch optimizes the validation of the name of an interface.

This commit is contained in:
Stefan Berger 2010-04-02 14:57:01 -04:00
parent 8459218cbc
commit d9292cfefb

View File

@ -1795,7 +1795,7 @@ cleanup:
static bool
isValidIfname(const char *ifname) {
return (strspn(ifname, VALID_IFNAME_CHARS) == strlen(ifname));
return ifname[strspn(ifname, VALID_IFNAME_CHARS)] == 0;
}