diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-06-02 05:00:48 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-06-02 05:00:48 -0400 |
commit | 76f440cff73878a7359e944618a7722dfd23bdec (patch) | |
tree | 1792a5a1b2db7e946fcdda1da16e7bb0e1641127 /src/network/inet_addr.c | |
parent | 3330198060c7b3165a2fba530ffde5fc6706ecf2 (diff) | |
download | musl-76f440cff73878a7359e944618a7722dfd23bdec.tar.gz musl-76f440cff73878a7359e944618a7722dfd23bdec.tar.bz2 musl-76f440cff73878a7359e944618a7722dfd23bdec.tar.xz musl-76f440cff73878a7359e944618a7722dfd23bdec.zip |
remove cruft from old resolver and numeric ip parsing
the old resolver code used a function __ipparse which contained the
logic for inet_addr and inet_aton, which is needed in getaddrinfo.
this was phased out in the resolver overhaul in favor of directly
using inet_aton and inet_pton as appropriate.
this commit cleans up some stuff that was left behind.
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; } |