On Fri, 2015-04-17 at 16:23 +0530, Saurav Babu wrote:
> When Nameservers and IP Configurations are changed from manual to DHCP
> simultaneously then in few scenarios connman's service was in
> Configuration state while trying to remove nameservers_config from
> service,

In set_property(), a few lines after removing current nameservers, the
new nameservers are set and a call to update_nameservers() is done.
update_nameservers() updates everything, if possible. That function
returns immediately if state is configuration, so I'm wondering how the
nameservers are added in the first place? I assume you used different
nameservers from the DHCP ones so that you ruled out the ones set by
DHCP, correct?

>  so nameservers_config were not removed from resolv.conf. This
> patch removes the nameservers_config with the index of service rather
> than checking the service's connection state.

If the service's state is not checked, somebody else's nameservers may
get removed as the index may still be set although the interface already
belongs to a different service.

> ---
>  src/service.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/service.c b/src/service.c
> index 29a632e..09c2c75 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -3207,6 +3207,7 @@ static DBusMessage *set_property(DBusConnection *conn,
>               GString *str;
>               int index;
>               const char *gw;
> +             DBG("%s", name);
>  
>               if (__connman_provider_is_immutable(service->provider) ||
>                               service->immutable)
> @@ -3241,7 +3242,7 @@ static DBusMessage *set_property(DBusConnection *conn,
>                       }
>               }
>  
> -             remove_nameservers(service, -1, service->nameservers_config);
> +             remove_nameservers(service, index, service->nameservers_config);
>               g_strfreev(service->nameservers_config);
>  
>               if (str->len > 0) {

Cheers,

        Patrik

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to