service: Do not allow service to be moved before a VPN service
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 26 Aug 2011 08:33:24 +0000 (11:33 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Sep 2011 09:40:47 +0000 (11:40 +0200)
This is needed as the default routes are not set properly
if we allow a service to be moved before a VPN service.

src/service.c

index 7a62f3d..ea54a79 100644 (file)
@@ -3284,7 +3284,8 @@ static DBusMessage *move_service(DBusConnection *conn,
                return __connman_error_not_supported(msg);
 
        target = find_service(path);
-       if (target == NULL || target->favorite == FALSE || target == service)
+       if (target == NULL || target->favorite == FALSE || target == service ||
+                               target->type == CONNMAN_SERVICE_TYPE_VPN)
                return __connman_error_invalid_service(msg);
 
        target4 = __connman_ipconfig_get_method(target->ipconfig_ipv4);