From 927d42bdf8d84501e2a0011e8d12dbe635ecefdd Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Thu, 29 Apr 2021 11:03:40 +0000 Subject: #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. --- src/rest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rest.c b/src/rest.c index 9823b0f..337ee40 100644 --- a/src/rest.c +++ b/src/rest.c @@ -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; -- cgit v1.2.3-18-g5258