mirror of
git://git.musl-libc.org/musl
synced 2024-11-23 18:14:19 +08:00
fix inet_aton to accept the generic "numbers-and-dots" IPv4 address format
This commit is contained in:
parent
bb93ac3358
commit
59b8dc08f7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user