merge a few fixes by sh4rm4
This commit is contained in:
commit
5d5ab51862
5 changed files with 34 additions and 1 deletions
11
src/network/inet_network.c
Normal file
11
src/network/inet_network.c
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue