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:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user