From 44c6296cae4d777d6757ea861182b2eda2600ada Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 10 Jul 2015 17:23:38 +0200 Subject: [PATCH] vpn: don't set the gateway of VPN's IP config to the external gateway The gateway property of NMIP4Config/IP6Config determines the next hop for the default route. That is different from the @external_gw property of the VPN which is the address of the world-reachable VPN gateway. It is wrong to set the gateway of the VPN's IP config to the external gateway. This causes ip4_config_merge_and_apply() to overwrite the gateway of the underlying device. Instead, NMDefaultRouteManger gets the gateway directly from the VPN connection by quering nm_vpn_connection_get_ip4_internal_gateway(). (cherry picked from commit 5cd131610088c3b54fde02aa1ecd06ce69fbb2a8) --- src/vpn-manager/nm-vpn-connection.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index f18b970bbe..a6ceb77a2f 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1194,8 +1194,6 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, memset (&address, 0, sizeof (address)); address.plen = 24; - if (priv->ip4_external_gw) - nm_ip4_config_set_gateway (config, priv->ip4_external_gw); /* Internal address of the VPN subnet's gateway */ val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY); @@ -1339,8 +1337,6 @@ nm_vpn_connection_ip6_config_get (DBusGProxy *proxy, memset (&address, 0, sizeof (address)); address.plen = 128; - if (priv->ip6_external_gw) - nm_ip6_config_set_gateway (config, priv->ip6_external_gw); /* Internal address of the VPN subnet's gateway */ g_clear_pointer (&priv->ip6_internal_gw, g_free);