service: Fix wrong DNS server ip after VPN connection
authorYu A Wang <yu.a.wang@intel.com>
Fri, 12 Aug 2011 06:43:26 +0000 (02:43 -0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 16 Aug 2011 18:32:19 +0000 (20:32 +0200)
We need to call default_changed function for ONLINE state after
profile changed, else get_default function will return the previous
service, this will lead to we have wrong DNS after VPN connection

src/service.c

index 81c4f60..f5312b5 100644 (file)
@@ -3535,8 +3535,6 @@ static int __connman_service_indicate_state(struct connman_service *service)
                }
 
                connman_timeserver_sync();
-
-               default_changed();
        }
 
        if (new_state == CONNMAN_SERVICE_STATE_IDLE) {
@@ -3629,6 +3627,9 @@ static int __connman_service_indicate_state(struct connman_service *service)
 
        __connman_profile_changed(FALSE);
 
+       if (new_state == CONNMAN_SERVICE_STATE_ONLINE)
+               default_changed();
+
        return 0;
 }