[PATCH] Fix incorrect return value of inet_aton() shim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at sapika.ch>
---
 compat.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat.c b/compat.c
index f70d0af..5844f6f 100644
--- a/compat.c
+++ b/compat.c
@@ -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
 
-- 
1.7.5.GIT




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux