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().
This commit is contained in:
Thomas Haller 2015-07-10 17:23:38 +02:00
parent 16d0850c37
commit 5cd1316100

View file

@ -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);