merge a few fixes by sh4rm4

This commit is contained in:
Rich Felker 2012-12-19 13:07:37 -05:00
commit 5d5ab51862
5 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,11 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "__dns.h"
in_addr_t inet_network(const char *p)
{
struct sockaddr_in sin;
if (__ipparse(&sin, AF_INET, p)) return -1;
return ntohl(sin.sin_addr.s_addr);
}