[PATCH 6/9] service: Show FallbackNameservers in service API

Peter Meerwald pmeerw at pmeerw.net
Fri Sep 13 03:32:18 PDT 2013


Hi,

> On Tue, 2013-09-10 at 15:46 +0200, Peter Meerwald wrote:
> > --- a/src/service.c
> > +++ b/src/service.c
> > @@ -1562,11 +1562,17 @@ static void append_dns(DBusMessageIter *iter, void *user_data)
> >  		append_nameservers(iter, service->nameservers_config);
> >  		return;
> >  	} else {
> > +		char **ns;
> > +
> >  		if (service->nameservers)
> >  			append_nameservers(iter, service->nameservers);
> >  
> >  		if (service->nameservers_auto)
> >  			append_nameservers(iter, service->nameservers_auto);
> > +
> > +		ns = connman_setting_get_string_list("FallbackNameservers");
> > +		if (ns)
> > +			append_nameservers(iter, ns);
> >  	}
> >  }
> >  
> 
> Reading the main.conf documentation says that FallbackNameservers should
> be used if no nameservers are set for a service. Thus
> FallbackNameservers should be announced over D-Bus only if both
> service->nameservers and service->nameservers_auto are unset.

I've tried to make sense of what the documentation says; 
list of questions is here: https://lists.connman.net/pipermail/connman/2013-September/015727.html
and growing :) I have a hard time figuring out what connman is supposed to 
do...

service-api.txt says:

  array{string} Nameservers [readonly]
    The list of currently active nameservers for this
    service. If the server is not in READY or ONLINE
    state than this list will be empty.

    Global nameservers are automatically added to this
    list. The array represents a sorted list of the
    current nameservers. The first one has the highest
    priority and is used by default.

so there is 'active' and 'global' which are not clear (to me at least)

connman.conf.5 says:

  FallbackNameservers=
  List of fallback nameservers separated by "," appended
  to the list of nameservers given by the service. The
  nameserver entries must be in numeric format, host
  names are ignored.

For FallbackTimeservers there is "These timeservers are used for NTP sync 
when there are no timeserver set by the user or by the service."; so such 
statement for FallbackNameservers

> Now the code doing this fallback nameservers is... hmmm, slightly
> misguided and seems not to take FallbackNamservers into account anymore.
> It most likely once did and needs to be fixed anyway.

I think service API should announce all Timeservers/Nameservers that may 
be queried

I think FallbackTimeservers/FallbackNameserver should be added to the list 
of Timeservers/Nameservers for a service

Timeservers.Configuration / Nameservers.Configuration may be used to 
override; if Timeservers.Configuration / Nameservers.Configuration then 
Timeservers / Nameservers := Timeservers.Configuration / Nameservers.Configuration 


I think there should be a clear strategy what is supposed to happen; for 
the moment it's a mess

I am trying to make this clear because I am looking for a consistent way 
to handle searchdomains

thanks, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)



More information about the connman mailing list