about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2013-10-22 12:23:17 +0000
committerSzabolcs Nagy <nsz@port70.net>2013-10-22 12:23:17 +0000
commit59b8dc08f712f156dd54e0aba50e4e647524ec8c (patch)
tree8b9b5dd6931ae02113b0801ab4fa95d163551850 /src
parentbb93ac335846424662212eea840859e7f0cc16b5 (diff)
downloadmusl-59b8dc08f712f156dd54e0aba50e4e647524ec8c.tar.gz
musl-59b8dc08f712f156dd54e0aba50e4e647524ec8c.tar.xz
musl-59b8dc08f712f156dd54e0aba50e4e647524ec8c.zip
fix inet_aton to accept the generic "numbers-and-dots" IPv4 address format
Diffstat (limited to 'src')
-rw-r--r--src/network/inet_legacy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/inet_legacy.c b/src/network/inet_legacy.c
index 9907c541..dd75420e 100644
--- a/src/network/inet_legacy.c
+++ b/src/network/inet_legacy.c
@@ -10,7 +10,10 @@ in_addr_t inet_network(const char *p)
 
 int inet_aton(const char *cp, struct in_addr *inp)
 {
-	return inet_pton(AF_INET, cp, (void *)inp) > 0;
+	struct sockaddr_in sin;
+	int r = __ipparse(&sin, AF_INET, cp);
+	*inp = sin.sin_addr;
+	return r;
 }
 
 struct in_addr inet_makeaddr(int net, int host)