If we remove the gateway when adding new one, then that will
prevent the VPN restart from working in all network configurations.
The reason is that if we remove the gateway here, then there will
not be any active gateway when the VPN is re-activated. This then
means that in connection.c:set_vpn_routes() the function will not
be able set the VPN server routes because the active_gateway variable
will be NULL as we just removed it. So simple solution is to not
remove the gateway.
---
 src/ipconfig.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/ipconfig.c b/src/ipconfig.c
index b23df16..b7e4f94 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1090,8 +1090,6 @@ int __connman_ipconfig_gateway_add(struct 
connman_ipconfig *ipconfig)
        if (!service)
                return -EINVAL;
 
-       __connman_connection_gateway_remove(service, ipconfig->type);
-
        DBG("type %d gw %s peer %s", ipconfig->type,
                ipconfig->address->gateway, ipconfig->address->peer);
 
-- 
1.8.3.1

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to