Hi Marcel,

On Tue, May 22, 2012 at 9:12 PM, Marcel Holtmann <mar...@holtmann.org>wrote:

> Hi Elena,
>
> > When connman is restarted, DNS servers are removed and added again
> > with function __connman_resolver_redo_servers(). While removing a
> > DNS entry, one should also remove the resolver timer registered for it.
> > Not doing so, causes the timeout handler resolver_expire_cb to fire
> > without being explicitly set.
> > ---
> > When implementing RDNSS refresh feature and executing connman restart,
> > the resolver_refresh_cb() handler is called before the timer
> > is actually started. This makes Connman to send Router Solicitation
> > in a case when this is not desired.
> > ---
> >  src/resolver.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
>
> I applied this patch, but I have one extra question below.
>
> >
> > diff --git a/src/resolver.c b/src/resolver.c
> > index 58af2f7..421b12f 100644
> > --- a/src/resolver.c
> > +++ b/src/resolver.c
> > @@ -493,6 +493,13 @@ int __connman_resolver_redo_servers(const char
> *interface)
> >                */
> >               __connman_dnsproxy_remove(entry->interface, entry->domain,
> >                                       entry->server);
> > +             /*
> > +              * Remove also the resolver timer for the old server entry.
> > +              * A new timer will be set for the new server entry
> > +              * when the next Router Advertisement message arrives
> > +              * with RDNSS/DNSSL settings.
> > +              */
> > +             g_source_remove(entry->timeout);
>
> don't we need to set entry->timeout = 0 as well?
>

[Elena] No, the timeout should not be set to zero here. If this would be
set to zero then by the time we receive another Router Advertisement with
same RDNSS server, function connman_resolver_append_lifetime() will add
another entry for the same server- by entering the code path which is
calling append_resolver() -. And this list will grow with every RA update.
I tested this scenario in connman and it confirms my understanding of the
code.

>
> >
> >               __connman_dnsproxy_append(entry->interface, entry->domain,
> >                                       entry->server);
>
> Regards
>
> Marcel
>



Regards,

Elena

>
>
> _______________________________________________
> connman mailing list
> connman@connman.net
> http://lists.connman.net/listinfo/connman
>
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to