On Fri, 2015-04-17 at 16:23 +0530, Saurav Babu wrote: > --- > src/service.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/src/service.c b/src/service.c > index 09c2c75..40c9382 100644 > --- a/src/service.c > +++ b/src/service.c > @@ -1130,8 +1130,9 @@ int __connman_service_nameserver_remove(struct > connman_service *service, > const char *nameserver, bool is_auto) > { > char **servers, **nameservers; > + char *servers_remove[2] = {(char *) nameserver, NULL}; > bool found = false; > - int len, i, j; > + int len, i, j, index; > > DBG("service %p nameserver %s auto %d", service, nameserver, is_auto); > > @@ -1159,12 +1160,9 @@ int __connman_service_nameserver_remove(struct > connman_service *service, > > if (len == 1) { > g_strfreev(nameservers); > - if (is_auto) > - service->nameservers_auto = NULL; > - else > - service->nameservers = NULL; > + nameservers = NULL; > > - return 0; > + goto remove; > } > > servers = g_try_new0(char *, len); > @@ -1184,6 +1182,10 @@ int __connman_service_nameserver_remove(struct > connman_service *service, > g_strfreev(nameservers); > nameservers = servers; > > +remove: > + index = __connman_service_get_index(service); > + remove_nameservers(service, index, servers_remove);
The index may be set, but does this service still own/use the interface and not some other service? Can this setting be omitted, and instead let update_nameservers() reset all nameservers? > + > if (is_auto) { > service->nameservers_auto = nameservers; > } else { Cheers, Patrik _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman