From 1e7fb12f775a3e599be08da9835422d96c56f479 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 19 Sep 2022 15:51:04 -0400 Subject: dns: treat names rejected by res_mkquery as nonexistent rather than error this distinction only affects search, but allows search to continue when concatenating one of the search domains onto the requested name produces a result that's not valid. this can happen when the concatenation is too long, or one of the search list entries is itself not valid. as a consequence of this change, having "." in the search domains list will now be ignored/skipped rather than making the lookup abort with no results (due to producing a concatenation ending in ".."). this behavior could be changed later if needed. --- src/network/lookup_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index b5232ce8..bec6ba22 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -153,7 +153,7 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static qlens[nq] = __res_mkquery(0, name, 1, afrr[i].rr, 0, 0, 0, qbuf[nq], sizeof *qbuf); if (qlens[nq] == -1) - return EAI_NONAME; + return 0; qbuf[nq][3] = 0; /* don't need AD flag */ /* Ensure query IDs are distinct. */ if (nq && qbuf[nq][0] == qbuf[0][0]) -- cgit 1.4.1