fix MAX_NET_IFACES not work

backport from 67d22950ed
This commit is contained in:
Jim Ma 2022-05-05 00:58:50 +08:00
parent b33f2bc221
commit 8c0236cb97

View File

@ -288,9 +288,9 @@ static bool extract_netif_macs(mac_address *macs[MAX_NET_IFACES], const char *pa
goto out_found;
}
//mac1=...mac4= are valid options. ASCII for 1 is 49, ASCII for 4 is 52
//mac1=...mac8= are valid options. ASCII for 1 is 49, ASCII for MAX_NET_IFACES is (49 + (MAX_NET_IFACES - 1)) # MAX_NET_IFACES must <=9
if (strncmp(param_pointer, "mac", 3) != 0 || *(param_pointer + 4) != '=' || *(param_pointer + 3) < 49 ||
*(param_pointer + 3) > 52)
*(param_pointer + 3) > (49 + (MAX_NET_IFACES - 1)))
return false;
//Find free spot