From 5cd592480e57608c5306ed743c23b3cc2d98455a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Apr 2012 12:00:53 +0300 Subject: connection: Remove original default route only when needed If the new VPN gateway has split routing set, then do not clear original default route because VPN will not set the default route. Without this check we would not get any proper default route set. --- src/connection.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/connection.c') diff --git a/src/connection.c b/src/connection.c index a679619d..11e42c9b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -820,14 +820,20 @@ int __connman_connection_gateway_add(struct connman_service *service, if (type == CONNMAN_IPCONFIG_TYPE_IPV4 && new_gateway->ipv4_gateway != NULL && new_gateway->ipv4_gateway->vpn == TRUE) { - connman_inet_clear_gateway_address(active_gateway->index, + if (__connman_service_is_split_routing(new_gateway->service) == + FALSE) + connman_inet_clear_gateway_address( + active_gateway->index, active_gateway->ipv4_gateway->gateway); } if (type == CONNMAN_IPCONFIG_TYPE_IPV6 && new_gateway->ipv6_gateway != NULL && new_gateway->ipv6_gateway->vpn == TRUE) { - connman_inet_clear_ipv6_gateway_address(active_gateway->index, + if (__connman_service_is_split_routing(new_gateway->service) == + FALSE) + connman_inet_clear_ipv6_gateway_address( + active_gateway->index, active_gateway->ipv6_gateway->gateway); } -- cgit v1.2.3