Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH] resolve: allow setting default DNS resolver at compile time
@ 2020-10-27 21:31 John Zimmermann
  2020-10-28 20:38 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: John Zimmermann @ 2020-10-27 21:31 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1601 bytes --]

---
 configure.ac  | 15 +++++++++++++++
 src/resolve.c |  4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 78db15e9..0adddd10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,6 +250,21 @@ if (test "${enable_systemd_service}" != "no" && test -z "${path_systemd_modloadd
 fi
 AC_SUBST(SYSTEMD_MODLOADDIR, [${path_systemd_modloaddir}])
 
+AC_ARG_WITH(resolver, AC_HELP_STRING([--with-resolver=(systemd|resolvconf)],
+			[Set default DNS resolver [default=systemd]]),,
+		[with_resolver=systemd])
+
+case "x$with_resolver" in
+	"xsystemd")
+		AC_DEFINE(DEFAULT_RESOLVER, "systemd", ["Default DNS resolver"])
+	;;
+	"xresolvconf")
+		AC_DEFINE(DEFAULT_RESOLVER, "resolvconf", ["Default DNS resolver"])
+	;;
+	*) AC_MSG_ERROR([Wrong value for --with-resolver: $with_resolver])
+	;;
+esac
+
 AC_ARG_ENABLE([external_ell], AC_HELP_STRING([--enable-external-ell],
 				[enable external Embedded Linux library]),
 					[enable_external_ell=${enableval}])
diff --git a/src/resolve.c b/src/resolve.c
index 066e4c87..8949edad 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -553,8 +553,8 @@ static int resolve_init(void)
 		if (method_name)
 			l_warn("[General].dns_resolve_method is deprecated, "
 				"use [Network].NameResolvingService");
-		else /* Default to systemd-resolved service. */
-			method_name = "systemd";
+		else /* Default to compile time option (default: systemd-resolved) */
+			method_name = DEFAULT_RESOLVER;
 	}
 
 	for (i = 0; resolve_method_ops_list[i].name; i++) {
-- 
2.29.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-01 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-27 21:31 [PATCH] resolve: allow setting default DNS resolver at compile time John Zimmermann
2020-10-28 20:38 ` Denis Kenzior
2020-11-01 21:33   ` John Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox