technology: Enable ethernet by default
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 27 Apr 2012 13:01:48 +0000 (16:01 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 27 Apr 2012 13:14:16 +0000 (15:14 +0200)
Ethernet is enabled by default if settings file is not found
or the Wired entry is not found in the file.

src/technology.c

index 27ada40..c523182 100644 (file)
@@ -304,7 +304,11 @@ static void load_state(struct connman_technology *technology)
        keyfile = __connman_storage_load_global();
        /* Fallback on disabling technology if file not found. */
        if (keyfile == NULL) {
-               technology->enable_persistent = FALSE;
+               if (technology->type == CONNMAN_SERVICE_TYPE_ETHERNET)
+                       /* We enable ethernet by default */
+                       technology->enable_persistent = TRUE;
+               else
+                       technology->enable_persistent = FALSE;
                return;
        }
 
@@ -316,7 +320,10 @@ static void load_state(struct connman_technology *technology)
        if (error == NULL)
                technology->enable_persistent = enable;
        else {
-               technology->enable_persistent = FALSE;
+               if (technology->type == CONNMAN_SERVICE_TYPE_ETHERNET)
+                       technology->enable_persistent = TRUE;
+               else
+                       technology->enable_persistent = FALSE;
                g_clear_error(&error);
        }
 done: