vpn: fix overwriting gateway of parent device for non-tunnel based VPNs

For non-tunnel based VPNs (openswan, libreswan), we must
clear the gateway setting. The default route is managed
by NMDefaultRouteManager, and we must not overwrite the
gateway of the parent device.
This fixes a bug if the VPN connection specifies a gateway, it
would have overwritten the gateway of the underlying device.

(cherry picked from commit 1465c1d326)
This commit is contained in:
Thomas Haller 2015-07-10 18:56:41 +02:00
parent 44c6296cae
commit 81945215c6

View file

@ -904,10 +904,17 @@ apply_parent_device_config (NMVpnConnection *connection)
* be done on the parent interface instead.
*/
if (vpn4_parent_config)
/* Also clear the gateway. We don't configure the gateway as part of the
* vpn-config. Instead we tell NMDefaultRouteManager directly about the
* default route. */
if (vpn4_parent_config) {
nm_ip4_config_merge (vpn4_parent_config, priv->ip4_config);
if (vpn6_parent_config)
nm_ip4_config_set_gateway (vpn4_parent_config, 0);
}
if (vpn6_parent_config) {
nm_ip6_config_merge (vpn6_parent_config, priv->ip6_config);
nm_ip6_config_set_gateway (vpn6_parent_config, NULL);
}
}
if (vpn4_parent_config) {