[Dnsmasq-discuss] [PATCH] Improve "no upstream servers configured" when D-Bus is enabled

Geert Stappers stappers at stappers.nl
Fri Jan 17 21:47:45 UTC 2025


On Sun, Jan 12, 2025 at 02:24:35PM +0000, Andrew Sayers wrote:
> Print a specific INFO message instead of a generic WARNING message,
> so users know what to do.
> 
> Starting dnsmasq without upstream servers indicates a problem by default,
> but is perfectly normal with D-Bus enabled.  For example, NetworkManager
> starts dnsmasq with no upstream servers, then immediately populates it
> over D-Bus.
> ---
>  src/dnsmasq.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/dnsmasq.c b/src/dnsmasq.c
> index 7f2686b..226599b 100644
> --- a/src/dnsmasq.c
> +++ b/src/dnsmasq.c
> @@ -961,7 +961,14 @@ int main (int argc, char **argv)
>  	my_syslog(LOG_WARNING, _("warning: ignoring resolv-file flag because no-resolv is set"));
>        daemon->resolv_files = NULL;
>        if (!daemon->servers)
> -	my_syslog(LOG_WARNING, _("warning: no upstream servers configured"));
> +	{
> +#ifdef HAVE_DBUS
> +	  if (option_bool(OPT_DBUS))
> +	    my_syslog(LOG_INFO, _("no upstream servers configured - please set them from DBus"));
> +	  else
> +#endif
> +	  my_syslog(LOG_WARNING, _("warning: no upstream servers configured"));
> +	}
>      } 
>  
>    if (daemon->max_logs != 0)
> -- 
> 2.47.1
> 

Looks good to me.

(That `git am` did complain some what, is considered "detail".)


Groeten
Geert Stappers
-- 
Silence is hard to parse



More information about the Dnsmasq-discuss mailing list