From 4bd409774c99bc9ff7425bbc24b86a337ca96d0d Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 17 Mar 2021 12:12:14 +0100 Subject: #990 incorrect inet_aton() error check inet_aton() reports 0 on failure --- src/ogAdmServer.c | 4 ++-- 1 file 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; } -- cgit v1.2.3-18-g5258