3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

ap: Fix an inet_aton error check

inet_aton returns 0 on error, not a negative number.
This commit is contained in:
Andrew Zaborowski 2021-02-26 17:17:23 +01:00 committed by Denis Kenzior
parent fd934aa39e
commit cdb2c2b3e3

View File

@ -213,7 +213,7 @@ static const char *broadcast_from_ip(const char *ip)
struct in_addr ia;
uint32_t bcast;
if (inet_aton(ip, &ia) < 0)
if (inet_aton(ip, &ia) != 1)
return NULL;
bcast = ntohl(ia.s_addr);