resolver: per service, defaultresolve, fakeresolve or sysresolve
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run

Each service resolves names the way the last of defaultresolve (the name
servers in force, configured or the system's with the hosts file),
fakeresolve (127.0.0.2) and sysresolve (the C library) read before it
says; the last one in the configuration also applies outside services.
defaultresolve is the new command, and the default.

The name servers and the hosts file no longer depend on the mode: nserver
lines, or the system's, are always in force, so dnspr keeps forwarding;
with fakeresolve it does not, as before. fakeresolver moves to common.c,
which the standalone services link without resolve.c.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-21 18:45:48 +03:00
1 parent 994526dbc4
commit 3d20e1104e
14 files changed
+181 -101

No files matched your search

+7 -1
View File
@@ -503,6 +503,11 @@ struct nserver {
};
#define MAXNSERVERS 3
/* how a service resolves names: defaultresolve (the name servers in force,
configured or the system's), fakeresolve, sysresolve (the C library) */
#define RESOLVE_DEFAULT 0
#define RESOLVE_FAKE 1
#define RESOLVE_SYSTEM 2
#define MAXRADIUS 5
struct radserver {
@@ -644,6 +649,7 @@ struct srvparam {
int transparent;
int nfilters, nreqfilters, nconnectfilters, nafterauthfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv;
int family;
int resolvmode; /* RESOLVE_* */
int stacksize;
struct extparam *config; /* the configuration it was started with */
int timeouts[12]; /* conf.timeouts as they were when the service started */
@@ -928,7 +934,7 @@ struct extparam {
int refs;
struct hashtable pwl_table; /* users */
int havelog; /* log was configured */
RESOLVFUNC resolvfunc; /* nserver or fakeresolve, in force once committed */
int resolvmode; /* RESOLVE_*: the last read, each service taking the one read before it */
};
struct property {