diff --git a/reactos/services/dhcp/compat.c b/reactos/services/dhcp/compat.c index 34ed1d488cd..ec132ca360a 100644 --- a/reactos/services/dhcp/compat.c +++ b/reactos/services/dhcp/compat.c @@ -30,6 +30,7 @@ u_int32_t arc4random() return ret; } + 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; } + diff --git a/reactos/services/dhcp/dhclient.c b/reactos/services/dhcp/dhclient.c index 88b05827fd6..6623a303c82 100644 --- a/reactos/services/dhcp/dhclient.c +++ b/reactos/services/dhcp/dhclient.c @@ -1986,7 +1986,7 @@ int ipv4addrs(char * buf) { char *tmp; - unsigned long jnk; + struct in_addr jnk; int i = 0; note("Input: %s\n", buf); @@ -1994,8 +1994,7 @@ ipv4addrs(char * buf) 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 ); diff --git a/reactos/services/dhcp/include/rosdhcp.h b/reactos/services/dhcp/include/rosdhcp.h index f27d0462e72..1efc5b355c7 100644 --- a/reactos/services/dhcp/include/rosdhcp.h +++ b/reactos/services/dhcp/include/rosdhcp.h @@ -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 int inet_aton(const char *s, struct in_addr *addr); int warn( char *format, ... ); #endif/*ROSDHCP_H*/