technology: Returns the right error when setting tethering
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thu, 13 Sep 2012 09:41:54 +0000 (12:41 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 13 Sep 2012 10:42:31 +0000 (13:42 +0300)
Fixes BMC#25721

src/technology.c

index 23122f2..3fc7afc 100644 (file)
@@ -712,8 +712,12 @@ static DBusMessage *set_property(DBusConnection *conn,
 
                dbus_message_iter_get_basic(&value, &tethering);
 
-               if (technology->tethering == tethering)
-                       return __connman_error_already_enabled(msg);
+               if (technology->tethering == tethering) {
+                       if (tethering == FALSE)
+                               return __connman_error_already_disabled(msg);
+                       else
+                               return __connman_error_already_enabled(msg);
+               }
 
                err = set_tethering(technology, tethering);
                if (err < 0)