Initiate IP conflict detection for wifi and ethernet only. 58/160658/2
authorNiraj Kumar Goit <niraj.g@samsung.com>
Fri, 17 Nov 2017 09:28:47 +0000 (14:58 +0530)
committertaesub kim <taesub.kim@samsung.com>
Mon, 20 Nov 2017 01:43:48 +0000 (10:43 +0900)
Initiate IP conflict detection logic for wifi and ethernet
network only. If device is connected to cellular network,
IP conflict detection logic is not required as unique IP address
is allocated by service provider.

Change-Id: Ic96b6f98e89b2fae17717f65e038e9e7b830ede6
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
src/signal-handler.c

index fb115ba..a858856 100755 (executable)
@@ -212,19 +212,21 @@ static void _service_signal_cb(GDBusConnection *conn,
        if (g_strcmp0(sigvalue, "State") == 0) {
                g_variant_get(variant, "s", &property);
 
-       if (g_strcmp0(property, "ready") == 0) {
-               for (idx = 0; idx < MAX_SOCKET_OPEN_RETRY; idx++) {
-                       sd = start_ip_conflict_mon();
-                       if (sd != NULL)
-                               break;
+       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();
                }
-       } else if (g_strcmp0(property, "online") == 0) {
-               // do nothing
-       } else {
-               stop_ip_conflict_mon();
        }
 
-               DBG("[%s] %s", property, path);
                if (netconfig_is_wifi_profile(path) == TRUE) {
                        int wifi_state = 0;