Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix incorrect return value of inet_aton() shim
inet_aton() returns nonzero if the address is valid, zero if not.

This bug caused INTERNAL_IP4_NETMASK not getting set and all split
routes was considered invalid under Windows.

Signed-off-by: Joe Hu <i@sapika.ch>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
SAPikachu authored and David Woodhouse committed Jul 10, 2014
1 parent a5eae19 commit 671c8eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compat.c
Expand Up @@ -216,14 +216,14 @@ 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 0;
return 1;
/* Is it an error, or was it really 255.255.255.255? */
if (!strcmp(cp, "255.255.255.255"))
return 0;
return 1;
#else
#error What is your INADDR_NONE?
#endif
return 1;
return 0;
}
#endif

Expand Down
3 changes: 2 additions & 1 deletion www/changelog.xml
Expand Up @@ -15,7 +15,8 @@
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
<li>Fix crash on invocation with <tt>--token-mode</tt> but no <tt>--token-secret</tt></li>
<li>Fix parsing of split include routes on Windows.</li>
<li>Fix crash on invocation with <tt>--token-mode</tt> but no <tt>--token-secret</tt>.</li>
</ul><br/>
</li>
<li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-6.00.tar.gz">OpenConnect v6.00</a></b>
Expand Down

0 comments on commit 671c8eb

Please sign in to comment.