summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-29 09:52:49 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-29 12:51:25 +0300
commitfb711e2f7b519860de188a0e2a5df70968643bf7 (patch)
treefa8e6ff6d02568dd5e439f730a87a6f034d7fd3e /src
parent79e3ee29897214150ca8fb4e4a9caaaa867c7c94 (diff)
downloadconnman-fb711e2f7b519860de188a0e2a5df70968643bf7.tar.gz
connman-fb711e2f7b519860de188a0e2a5df70968643bf7.tar.bz2
connman-fb711e2f7b519860de188a0e2a5df70968643bf7.zip
service: Check service type before fetching interface index
For VPNs, the index is available from provider, for other services from network. Fixes BMC#26009
Diffstat (limited to 'src')
-rw-r--r--src/service.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 9e79b039..ff6fc3c4 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3115,7 +3115,10 @@ static DBusMessage *set_property(DBusConnection *conn,
if (str == NULL)
return __connman_error_invalid_arguments(msg);
- index = connman_network_get_index(service->network);
+ if (service->type == CONNMAN_SERVICE_TYPE_VPN)
+ index = connman_provider_get_index(service->provider);
+ else
+ index = connman_network_get_index(service->network);
gw = __connman_ipconfig_get_gateway_from_index(index,
CONNMAN_IPCONFIG_TYPE_ALL);