diff --git a/connection.c b/connection.c --- a/connection.c +++ b/connection.c @@ -12,6 +12,10 @@ #include #include +#include +#include +#include + int connection (char *ip, unsigned short port) { struct hostent *hs; @@ -20,7 +24,7 @@ int sockfd; memset (&sock, 0, sizeof (sock)); - sock.sin_family = AF_INET; + sock.sin_family = PF_INET; sock.sin_port = htons (port); if ((sock.sin_addr.s_addr = inet_addr (ip)) == -1) { @@ -32,7 +36,7 @@ memcpy (&sock.sin_addr.s_addr, hs->h_addr_list[0], hs->h_length); } - if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { + if ((sockfd = socket (PF_INET, SOCK_STREAM, 0)) < 0) { perror ("[-] Error"); return -1; }