summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2021-03-17 12:12:14 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-03-17 12:12:14 +0100
commit4bd409774c99bc9ff7425bbc24b86a337ca96d0d (patch)
tree5309fdeb6d98bec841f1c72aaad6c11a9c3370ff
parent41bc66d0e7465ff8f3b59fcfd11079795608724b (diff)
#990 incorrect inet_aton() error check
inet_aton() reports 0 on failure
-rw-r--r--src/ogAdmServer.c4
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;
}