diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-04-29 11:03:40 +0000 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-04-29 13:11:34 +0200 |
commit | 927d42bdf8d84501e2a0011e8d12dbe635ecefdd (patch) | |
tree | 73b41f5ca82a4dfcc54005268a4074ba37f35e77 /src/rest.c | |
parent | 1f13855e412bba26064672b02dff78deecb795ab (diff) |
#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.
Diffstat (limited to 'src/rest.c')
-rw-r--r-- | src/rest.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |