Start IP conflict monitoring only after default profile has been updated
[platform/core/connectivity/net-config.git] / src / signal-handler.c
index 0552b46..8d7b66b 100755 (executable)
@@ -326,19 +326,6 @@ static void _service_signal_cb(GDBusConnection *conn,
                g_variant_get(variant, "s", &property);
 
                DBG("[%s] %s", property, path);
-               if (netconfig_is_wifi_profile(path) || netconfig_is_ethernet_profile(path)) {
-                       if (g_strcmp0(property, "ready") == 0) {
-                               for (idx = 0; idx < MAX_SOCKET_OPEN_RETRY; idx++) {
-                                       sd = start_ip_conflict_mon();
-                                       if (sd != NULL)
-                                               break;
-                               }
-                       } else if (g_strcmp0(property, "online") == 0) {
-                               // do nothing
-                       } else {
-                               stop_ip_conflict_mon();
-                       }
-               }
 
                if (netconfig_is_wifi_profile(path) == TRUE) {
                        int wifi_state = 0;
@@ -453,6 +440,21 @@ static void _service_signal_cb(GDBusConnection *conn,
                                netconfig_update_default_profile(NULL);
                        }
                }
+
+               if (netconfig_is_wifi_profile(path) || netconfig_is_ethernet_profile(path)) {
+                       if (g_strcmp0(property, "ready") == 0) {
+                               for (idx = 0; idx < MAX_SOCKET_OPEN_RETRY; idx++) {
+                                       sd = start_ip_conflict_mon();
+                                       if (sd != NULL)
+                                               break;
+                               }
+                       } else if (g_strcmp0(property, "online") == 0) {
+                               // do nothing
+                       } else {
+                               stop_ip_conflict_mon();
+                       }
+               }
+
                g_free(property);
        } else if (g_strcmp0(sigvalue, "Proxy") == 0) {
                if (netconfig_is_wifi_profile(path) != TRUE || g_strcmp0(path, netconfig_get_default_profile()) != 0)