From 5cd131610088c3b54fde02aa1ecd06ce69fbb2a8 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(). --- 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 33fde937b6..f3ff541c9c 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1182,8 +1182,6 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) 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 */ if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY, "u", &u32)) @@ -1308,8 +1306,6 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict) 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);