提交 59b8dc08 编写于 作者: S Szabolcs Nagy

fix inet_aton to accept the generic "numbers-and-dots" IPv4 address format

上级 bb93ac33
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册