These obsolete routes must be discarded as we cannot
contact VPN server via VPN tunnel.
---
 src/provider.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/provider.c b/src/provider.c
index ebc7055..7ba1670 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -466,6 +466,17 @@ static void provider_append_routes(gpointer key, gpointer 
value,
        struct connman_provider *provider = user_data;
        int index = provider->index;
 
+       /*
+        * If the VPN administrator/user has given a route to
+        * VPN server, then we must discard that because the
+        * server cannot be contacted via VPN tunnel.
+        */
+       if (g_strcmp0(provider->host, route->host) == 0) {
+               DBG("Discarding VPN route to %s via %s at index %d",
+                       route->host, route->gateway, index);
+               return;
+       }
+
        if (route->family == AF_INET6) {
                unsigned char prefix_len = atoi(route->netmask);
 
-- 
1.7.9.5

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

Reply via email to