[network-manager-fortisslvpn/nm-1-0] service: use the gateway address for routes without a gateway



commit 467801ed488cc8c225cf1098dcd48420d9d84d51
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Sep 29 15:17:57 2015 +0200

    service: use the gateway address for routes without a gateway
    
    This may happen with FortiOS 4 servers, where the client only learns the
    peer address from the PPP traffic, after routes are discovered and pppd
    is spawned.
    
    (cherry picked from commit 8b20e3ad28376cd99062f4c34d4fee3f81253837)

 src/nm-fortisslvpn-pppd-plugin.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-fortisslvpn-pppd-plugin.c b/src/nm-fortisslvpn-pppd-plugin.c
index c08ab46..c1d8d4a 100644
--- a/src/nm-fortisslvpn-pppd-plugin.c
+++ b/src/nm-fortisslvpn-pppd-plugin.c
@@ -162,7 +162,7 @@ value_destroy (gpointer data)
 }
 
 static GValue *
-get_ip4_routes (void)
+get_ip4_routes (in_addr_t ouraddr)
 {
        GPtrArray *routes;
        GValue *value = NULL;
@@ -196,7 +196,7 @@ get_ip4_routes (void)
                str = g_getenv (var);
                g_free (var);
                if (!str || !*str)
-                       gateway = 0;
+                       gateway = ouraddr;
                else
                        gateway = inet_addr (str);
 
@@ -261,7 +261,7 @@ nm_ip_up (void *data, int arg)
                g_warning ("nm-fortisslvpn-ppp-plugin: (%s): no external gateway!", __func__);
        }
 
-       val = get_ip4_routes ();
+       val = get_ip4_routes (opts.ouraddr);
        if (val)
                g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES, val);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]