service: Restart wispr on nameserver change
authorForest Bond <forest.bond@rapidrollout.com>
Wed, 5 Dec 2012 21:44:27 +0000 (16:44 -0500)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 6 Mar 2013 11:02:43 +0000 (13:02 +0200)
This is needed to make a service go online in the case where it was
already connected and then manual IPv4 & nameservers settings are
applied.  In that case, wispr is restarted with the new IP settings, but
the nameservers have not been set yet, so the wispr test fails and the
service remains in ready state.

src/service.c

index 4dfc86b44604e5cea23a922029778d513c32f755..edc6ef358fafde34de03bcc51d802cc3f6ce2e56 100644 (file)
@@ -3146,6 +3146,16 @@ static DBusMessage *set_property(DBusConnection *conn,
                update_nameservers(service);
                dns_configuration_changed(service);
 
+               if (__connman_service_is_connected_state(service,
+                                               CONNMAN_IPCONFIG_TYPE_IPV4))
+                       __connman_wispr_start(service,
+                                               CONNMAN_IPCONFIG_TYPE_IPV4);
+
+               if (__connman_service_is_connected_state(service,
+                                               CONNMAN_IPCONFIG_TYPE_IPV6))
+                       __connman_wispr_start(service,
+                                               CONNMAN_IPCONFIG_TYPE_IPV6);
+
                service_save(service);
        } else if (g_str_equal(name, "Timeservers.Configuration") == TRUE) {
                DBusMessageIter entry;