diff options
author | Test_User <hax@andrewyu.org> | 2024-07-24 23:48:25 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2024-07-24 23:48:25 -0400 |
commit | d4afb359bc2a41c16cc8ce7baac58a5fad94c468 (patch) | |
tree | 71da9038c6721ba351b33cb6098b6d310b961050 /server_network.c | |
parent | 86344230a6bb79b95880769fbee4d859583c9ac4 (diff) | |
download | haxircd-d4afb359bc2a41c16cc8ce7baac58a5fad94c468.tar.gz haxircd-d4afb359bc2a41c16cc8ce7baac58a5fad94c468.zip |
Toggleable IPv4 support
Diffstat (limited to '')
-rw-r--r-- | server_network.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server_network.c b/server_network.c index cbe00a1..77ebd6f 100644 --- a/server_network.c +++ b/server_network.c @@ -121,6 +121,7 @@ int start_server_network_threads(size_t net) { struct server_network_info *type; for (size_t i = 0; i < NUM_PROTOCOLS; i++) { if (active_protocols[i] && SERVER_INCOMING[net][i]) { +#ifdef USE_IPv4 type = malloc(sizeof(*type)); if (!type) return 1; @@ -132,6 +133,7 @@ int start_server_network_threads(size_t net) { free(type); return 1; } +#endif #ifdef USE_IPv6 type = malloc(sizeof(*type)); @@ -176,8 +178,12 @@ void * server_accept_thread(void *type) { .ss_family = family, }; - if (family == AF_INET) { + if (0) { +#ifdef USE_IPv4 + } else if (family == AF_INET) { ((struct sockaddr_in *)&sockaddr)->sin_port = htons(SERVER_PORTS[net][protocol]); +#endif + #ifdef USE_IPv6 } else if (family == AF_INET6) { int one = 1; |