* [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* Re: [PATCH] resolve: allow setting default DNS resolver at compile time
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
0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2020-10-28 20:38 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
Hi John,
On 10/27/20 4:31 PM, John Zimmermann wrote:
> ---
> configure.ac | 15 +++++++++++++++
> src/resolve.c | 4 ++--
> 2 files changed, 17 insertions(+), 2 deletions(-)
Could you explain the motivation behind this change? Can't this be accomplished
easily by shipping a default main.conf?
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] resolve: allow setting default DNS resolver at compile time
2020-10-28 20:38 ` Denis Kenzior
@ 2020-11-01 21:33 ` John Zimmermann
0 siblings, 0 replies; 3+ messages in thread
From: John Zimmermann @ 2020-11-01 21:33 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Hi Denis.
On Wed, Oct 28, 2020, at 9:38 PM, Denis Kenzior wrote:
> Hi John,
>
> Could you explain the motivation behind this change? Can't this be accomplished
> easily by shipping a default main.conf?
>
> Regards,
> -Denis
>
Yes in theory most of this can be achieved with a main.conf. Our problem is,
that our package manager (xbps) would overwrite already exisiting main.conf files,
since they aren't yet tracked by it.
So patching iwd is our most reliable method that won't break any users config.
Regards,
John
[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 976 bytes --]
^ permalink raw reply [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