diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-03-17 12:12:14 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-03-17 12:12:14 +0100 |
commit | 4bd409774c99bc9ff7425bbc24b86a337ca96d0d (patch) | |
tree | 5309fdeb6d98bec841f1c72aaad6c11a9c3370ff /src/ogAdmServer.c | |
parent | 41bc66d0e7465ff8f3b59fcfd11079795608724b (diff) |
#990 incorrect inet_aton() error check
inet_aton() reports 0 on failure
Diffstat (limited to 'src/ogAdmServer.c')
-rw-r--r-- | src/ogAdmServer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ogAdmServer.c b/src/ogAdmServer.c index 22fbfb1..fa7e29a 100644 --- a/src/ogAdmServer.c +++ b/src/ogAdmServer.c @@ -329,12 +329,12 @@ bool WakeUp(int s, char* iph, char *mac, char *netmask, char *mar) bool ret; int i; - if (inet_aton(iph, &addr) < 0) { + if (!inet_aton(iph, &addr)) { syslog(LOG_ERR, "bad IP address\n"); return false; } - if (inet_aton(netmask, &netmask_addr) < 0) { + if (!inet_aton(netmask, &netmask_addr)) { syslog(LOG_ERR, "bad netmask address: %s\n", netmask); return false; } |