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 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index a679619..11e42c9 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);
        }
 
-- 
1.7.5.4

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to