The attached patch optimizes the validation of the name of an interface.
This commit is contained in:
parent
8459218cbc
commit
d9292cfefb
@ -1795,7 +1795,7 @@ cleanup:
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
isValidIfname(const char *ifname) {
|
isValidIfname(const char *ifname) {
|
||||||
return (strspn(ifname, VALID_IFNAME_CHARS) == strlen(ifname));
|
return ifname[strspn(ifname, VALID_IFNAME_CHARS)] == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user