> On Fri, 2013-11-22 at 14:19 +0100, Peter Meerwald wrote:
> > Connman state does not change to online if only fallback nameservers
> > are configured. Wispr queries connman_service_get_nameservers() and
> > aborts if no nameservers are returned.
> >
> > So if no explicit nameservers are configured for a service, but
> > fallback nameservers are available, return these.
> > ---
> > src/service.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/service.c b/src/service.c
> > index 8753247..f031281 100644
> > --- a/src/service.c
> > +++ b/src/service.c
> > @@ -2425,9 +2425,13 @@ char **connman_service_get_nameservers(struct
> > connman_service *service)
> > g_strdup(service->nameservers_auto[i]);
> >
> > return nameservers;
> > - }
> > + } else {
> > + char **ns =
> > connman_setting_get_string_list("FallbackNameservers");
> > + if (!ns)
> > + return NULL;
> >
> > - return NULL;
> > + return g_strdupv(ns);
> > + }
>
> Good catch!
>
> The 'else {' and '}' are not needed as all other code paths have already
> returned. IIRC g_strdupv accepts NULL, so that doesn't need checking
> either.
just posted v2 of the patch as a one-liner; g_strdupv(NULL) -> NULL is
documented behaviour
thanks, p.
--
Peter Meerwald
+43-664-2444418 (mobile)
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman