These patches properly removes nameservers from resolv.conf before clearing
nameservers in service structure when IPv4.Configurations and
Nameservers.Configurations are changed simultaneously.

Connman was being run with nodnsproxy flag enabled.
Checked using scripts of connman's test directory:
set-ipv4-method <profile> manual <ip> <subnet> <gw>; set-nameservers <profile> 
<dns> <dns>
set-ipv4-method <profile> dhcp; set-nameservers <profile>

There are two possible cases:
CASE 1: Nameservers and IP Configurations are changed from manual to DHCP
In this case there were few scenarios where connman's service was in
Configuration state while trying to remove nameservers_config from
service, and 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.
Fixed by [Patchv2 1/2]

CASE 2: Nameservers and IP Configurations are changed from DHCP to manual
In this case nameservers in service structure was cleared without
removing from resolv.conf in function __connman_service_nameserver_remove()
if there was only one nameservers. When there were more than one nameservers
then nameservers structure was updated with the nameserver passed in
argument of __connman_service_nameserver_remove() so other nameservers
were not getting removed. This patch updates nameservers structure with
all the other nameservers which are not passed to this function and the
one passed to this function is removed from both service's nameservers
structure and resolv.conf.
Fixed by [Patchv2 2/2]


Saurav Babu (2):
  service: Properly remove older configured Nameservers
  service: Properly remove Nameservers when DHCP lease is invalidated

 src/service.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

-- 
1.9.1

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

Reply via email to