Skip to content

Commit

Permalink
Use inet_pton() to provide inet_aton() functionality
Browse files Browse the repository at this point in the history
This is cleaner and simpler than the original compat code, and avoids
the strange issues that Nikos was reporting on his Windows 7
installation with inet_addr() not working correctly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 22, 2014
1 parent c499aec commit f1e4cf5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions compat.c
Expand Up @@ -223,17 +223,7 @@ void openconnect__unsetenv(const char *name)
#ifndef HAVE_INET_ATON
int openconnect__inet_aton(const char *cp, struct in_addr *addr)
{
addr->s_addr = inet_addr(cp);
#if INADDR_NONE == 0xffffffff
if (addr->s_addr != 0xffffffff)
return 1;
/* Is it an error, or was it really 255.255.255.255? */
if (!strcmp(cp, "255.255.255.255"))
return 1;
#else
#error What is your INADDR_NONE?
#endif
return 0;
return inet_pton(AF_INET, cp, addr);
}
#endif

Expand Down

0 comments on commit f1e4cf5

Please sign in to comment.