fix inet_aton problem
authorChristoph von Wittich <christoph_vw@reactos.org>
Sat, 22 Oct 2005 20:02:03 +0000 (20:02 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sat, 22 Oct 2005 20:02:03 +0000 (20:02 +0000)
svn path=/trunk/; revision=18687

reactos/services/dhcp/compat.c
reactos/services/dhcp/dhclient.c
reactos/services/dhcp/include/rosdhcp.h

index 34ed1d4..ec132ca 100644 (file)
@@ -30,6 +30,7 @@ u_int32_t arc4random()
        return ret;
 }
 
        return ret;
 }
 
+
 int inet_aton(const char *cp, struct in_addr *inp)
 {
        inp->S_un.S_addr = inet_addr(cp);
 int inet_aton(const char *cp, struct in_addr *inp)
 {
        inp->S_un.S_addr = inet_addr(cp);
@@ -38,3 +39,4 @@ int inet_aton(const char *cp, struct in_addr *inp)
 
        return 1;
 }
 
        return 1;
 }
+
index 88b0582..6623a30 100644 (file)
@@ -1986,7 +1986,7 @@ int
 ipv4addrs(char * buf)
 {
     char *tmp;
 ipv4addrs(char * buf)
 {
     char *tmp;
-    unsigned long jnk;
+    struct in_addr jnk;
     int i = 0;
 
     note("Input: %s\n", buf);
     int i = 0;
 
     note("Input: %s\n", buf);
@@ -1994,8 +1994,7 @@ ipv4addrs(char * buf)
     do {
         tmp = strtok(buf, " ");
         note("got %s\n", tmp);
     do {
         tmp = strtok(buf, " ");
         note("got %s\n", tmp);
-               jnk = inet_addr( tmp );
-               if( tmp ) i++;
+               if( tmp && inet_aton(tmp, &jnk) ) i++;
         buf = NULL;
     } while( tmp );
 
         buf = NULL;
     } while( tmp );
 
index f27d046..1efc5b3 100644 (file)
@@ -67,5 +67,6 @@ extern DWORD DSQueryHWInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSReleaseIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
 extern DWORD DSReleaseIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req );
+extern int inet_aton(const char *s, struct in_addr *addr);
 int warn( char *format, ... );
 #endif/*ROSDHCP_H*/
 int warn( char *format, ... );
 #endif/*ROSDHCP_H*/