hostapd: make cli treat UNKNOWN COMMAND as failing
Avoid infinite loop at 100% CPU when running hostapd_cli if CONFIG_CTRL_IFACE_MIB is not defined. _newselect(4, [3], NULL, NULL, ...) recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16 sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
This commit is contained in:
parent
dd29de8196
commit
10bbad15ac
1 changed files with 1 additions and 1 deletions
|
@ -761,7 +761,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
if (memcmp(buf, "FAIL", 4) == 0)
|
if (memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (print)
|
if (print)
|
||||||
printf("%s", buf);
|
printf("%s", buf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue