2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Don't use route socket in unit tests

Some of the libns unit tests override the isc_nmhandle_attach() and
_detach() functions. This causes a failure in ns_interface_create()
if a route socket is being used, so we add a parameter to disable it.
This commit is contained in:
Evan Hunt
2021-10-03 01:01:40 -07:00
parent a55589f881
commit ab98e95f4c
4 changed files with 11 additions and 15 deletions

View File

@@ -190,7 +190,7 @@ ns_interfacemgr_create(isc_mem_t *mctx, ns_server_t *sctx,
isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr,
isc_nm_t *nm, dns_dispatchmgr_t *dispatchmgr,
isc_task_t *task, dns_geoip_databases_t *geoip,
int ncpus, ns_interfacemgr_t **mgrp) {
int ncpus, bool scan, ns_interfacemgr_t **mgrp) {
isc_result_t result;
ns_interfacemgr_t *mgr = NULL;
@@ -242,11 +242,13 @@ ns_interfacemgr_create(isc_mem_t *mctx, ns_server_t *sctx,
UNUSED(geoip);
#endif /* if defined(HAVE_GEOIP2) */
result = isc_nm_routeconnect(nm, route_connected, mgr, 0);
if (result != ISC_R_SUCCESS) {
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_INFO,
"unable to open route socket: %s",
isc_result_totext(result));
if (scan) {
result = isc_nm_routeconnect(nm, route_connected, mgr, 0);
if (result != ISC_R_SUCCESS) {
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_INFO,
"unable to open route socket: %s",
isc_result_totext(result));
}
}
isc_refcount_init(&mgr->references, 1);