tethering: Set tethering_status earlier
authorMartin Xu <martin.xu@intel.com>
Fri, 3 Dec 2010 11:06:47 +0000 (19:06 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 7 Dec 2010 18:24:16 +0000 (19:24 +0100)
With synchronous technologies (e.g. ethernet),
connman_technology_tethering_notify() is called immediatly after
enabling or disabling tethering. If tethering_status is not properly
set, then that will fail.

src/tethering.c

index e8d09c0..2915194 100644 (file)
@@ -349,13 +349,13 @@ int __connman_tethering_set_status(connman_bool_t status)
        if (status == tethering_status)
                return -EALREADY;
 
+       tethering_status = status;
+
        if (status == TRUE)
                __connman_technology_enable_tethering(BRIDGE_NAME);
        else
                __connman_technology_disable_tethering(BRIDGE_NAME);
 
-       tethering_status = status;
-
        return 0;
 }