diff options
Diffstat (limited to 'src/network/inet_addr.c')
-rw-r--r-- | src/network/inet_addr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/inet_addr.c b/src/network/inet_addr.c index ea0a8f7a..10b21f21 100644 --- a/src/network/inet_addr.c +++ b/src/network/inet_addr.c @@ -1,11 +1,12 @@ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> -#include "__dns.h" + +int __inet_aton(const char *, struct in_addr *); in_addr_t inet_addr(const char *p) { - struct sockaddr_in sin; - if (__ipparse(&sin, AF_INET, p) < 0) return -1; - return sin.sin_addr.s_addr; + struct in_addr a; + if (!__inet_aton(p, &a)) return -1; + return a.s_addr; } |