1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Fix compile problem with central-blocklist on FreeBSD.

This commit is contained in:
Bram Matthys
2023-11-24 09:13:13 +01:00
parent 6aae3e7a5d
commit d73c8b30d2
2 changed files with 5 additions and 11 deletions
+4
View File
@@ -66,6 +66,10 @@
#include <afunix.h> #include <afunix.h>
#endif #endif
#ifdef HAVE_TCP_INFO
#include <netinet/tcp.h>
#endif
#ifndef _WIN32 #ifndef _WIN32
#include <sys/time.h> #include <sys/time.h>
#endif #endif
+1 -11
View File
@@ -32,16 +32,6 @@ module
#define HOOKTYPE_GET_CENTRAL_API_KEY 199 #define HOOKTYPE_GET_CENTRAL_API_KEY 199
#endif #endif
/* Code for 6.1.2.x, not needed in 6.1.3+ anymore: */
#if (UNREAL_VERSION_TIME < 202343) && (defined(__linux__) || defined(__FreeBSD__))
#include <netinet/tcp.h>
#if defined(TCP_INFO) && defined(SOL_TCP)
#define HAVE_TCP_INFO 1
#endif
#elif defined(HAVE_TCP_INFO)
#include <netinet/tcp.h>
#endif
ModuleHeader MOD_HEADER ModuleHeader MOD_HEADER
= { = {
"central-blocklist", "central-blocklist",
@@ -659,7 +649,7 @@ void cbl_add_client_info(Client *client)
struct tcp_info tcp_info; struct tcp_info tcp_info;
optlen = sizeof(tcp_info); optlen = sizeof(tcp_info);
memset(&tcp_info, 0, sizeof(tcp_info)); memset(&tcp_info, 0, sizeof(tcp_info));
if (getsockopt(client->local->fd, SOL_TCP, TCP_INFO, (void *)&tcp_info, &optlen) == 0) if (getsockopt(client->local->fd, IPPROTO_TCP, TCP_INFO, (void *)&tcp_info, &optlen) == 0)
{ {
json_t *j = json_object(); json_t *j = json_object();
json_object_set_new(child, "tcp_info", j); json_object_set_new(child, "tcp_info", j);