diff options
Diffstat (limited to 'sakkom.c')
-rw-r--r-- | sakkom.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -12,6 +12,8 @@ #include <stdlib.h> #include <string.h> #include <sys/types.h> +#include <netinet/in.h> +#include <sys/socket.h> #include <time.h> #include <unistd.h> @@ -634,11 +636,11 @@ int main() { struct sockaddr_in listen_addr = {0}, client_addr = {0}; struct sockaddr_in6 listen6_addr = {0}; - if ((listen_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { + if ((listen_fd = socket(PF_INET, SOCK_STREAM, 0)) == -1) { perror("IPv4 socket"); exit(EXIT_FAILURE); } - if ((listen6_fd = socket(AF_INET6, SOCK_STREAM, 0)) == -1) { + if ((listen6_fd = socket(PF_INET6, SOCK_STREAM, 0)) == -1) { perror("IPv6 socket"); exit(EXIT_FAILURE); } |