#1043 don't create wol entries when client is connected

Avoids multiple entries of a same client like

{"clients": [{"addr": "192.168.2.230", "state": "WOL_SENT"}, {"addr": "192.168.2.230", "state": "OPG"}]

These can arise when ogserver processes a WoL request for an already
connected client.

When processing the WoL request, search for the target address in the
clients list, if found we avoid creating the wol entry.
master
Jose M. Guisado 2021-04-29 11:03:40 +00:00 committed by OpenGnSys Support Team
parent 1f13855e41
commit 927d42bdf8
1 changed files with 3 additions and 0 deletions

View File

@ -571,6 +571,9 @@ static int og_cmd_wol(json_t *element, struct og_msg_params *params)
return 0;
for (i = 0; i < params->ips_array_len; i++) {
if (og_client_find(params->ips_array[i]))
continue;
if (inet_aton(params->ips_array[i], &addr) < 0)
return -1;