mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-03 22:10:35 -05:00
Enable the load-balance-sockets configuration
Previously, HAVE_SO_REUSEPORT_LB has been defined only in the private netmgr-int.h header file, making the configuration of load balanced sockets inoperable. Move the missing HAVE_SO_REUSEPORT_LB define the isc/netmgr.h and add missing isc_nm_getloadbalancesockets() implementation.
This commit is contained in:
parent
9217f1e200
commit
142c63dda8
5 changed files with 18 additions and 4 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include <isc/buffer.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/netmgr.h>
|
||||
#include <isc/parseint.h>
|
||||
#include <isc/region.h>
|
||||
#include <isc/result.h>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include <isc/httpd.h>
|
||||
#include <isc/lex.h>
|
||||
#include <isc/meminfo.h>
|
||||
#include <isc/netmgr.h>
|
||||
#include <isc/nonce.h>
|
||||
#include <isc/parseint.h>
|
||||
#include <isc/portset.h>
|
||||
|
|
|
|||
|
|
@ -13,12 +13,21 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/region.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/tls.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(SO_REUSEPORT_LB) || (defined(SO_REUSEPORT) && defined(__linux__))
|
||||
#define HAVE_SO_REUSEPORT_LB 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Replacement for isc_sockettype_t provided by socket.h.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -111,10 +111,6 @@ STATIC_ASSERT(ISC_NETMGR_TCP_RECVBUF_SIZE <= ISC_NETMGR_RECVBUF_SIZE,
|
|||
*/
|
||||
#define NM_MAXSEG (1280 - 20 - 40)
|
||||
|
||||
#if defined(SO_REUSEPORT_LB) || (defined(SO_REUSEPORT) && defined(__linux__))
|
||||
#define HAVE_SO_REUSEPORT_LB 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define NETMGR_TRACE to activate tracing of handles and sockets.
|
||||
* This will impair performance but enables us to quickly determine,
|
||||
|
|
|
|||
|
|
@ -578,6 +578,13 @@ isc_nm_setnetbuffers(isc_nm_t *mgr, int32_t recv_tcp, int32_t send_tcp,
|
|||
atomic_store(&mgr->send_udp_buffer_size, send_udp);
|
||||
}
|
||||
|
||||
bool
|
||||
isc_nm_getloadbalancesockets(isc_nm_t *mgr) {
|
||||
REQUIRE(VALID_NM(mgr));
|
||||
|
||||
return (mgr->load_balance_sockets);
|
||||
}
|
||||
|
||||
void
|
||||
isc_nm_setloadbalancesockets(isc_nm_t *mgr, bool enabled) {
|
||||
REQUIRE(VALID_NM(mgr));
|
||||
|
|
|
|||
Loading…
Reference in a new issue