vpn: don't choose route priority for VPN connections based on the parent device

The parent device is just the device that happens to be the best device.
It does not mean, that its route metric should be inherited to the VPN
connection.

This also makes the resulting route metric for VPN connections much
more predictable: now it is either ipv4.route-metric from the connection,
or it falls back to NM_VPN_ROUTE_METRIC_DEFAULT (10).
This commit is contained in:
Thomas Haller 2014-11-26 17:58:29 +01:00
parent 382906c391
commit 3210bb93a1

View file

@ -1123,7 +1123,6 @@ nm_vpn_connection_config_get (DBusGProxy *proxy,
guint32
nm_vpn_connection_get_ip4_route_metric (NMVpnConnection *connection)
{
NMDevice *parent_dev;
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
if (priv->connection) {
@ -1133,17 +1132,12 @@ nm_vpn_connection_get_ip4_route_metric (NMVpnConnection *connection)
return route_metric;
}
if ( priv->ip_ifindex
|| !(parent_dev = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (connection))))
return NM_VPN_ROUTE_METRIC_DEFAULT;
return nm_device_get_ip4_route_metric (parent_dev);
return NM_VPN_ROUTE_METRIC_DEFAULT;
}
guint32
nm_vpn_connection_get_ip6_route_metric (NMVpnConnection *connection)
{
NMDevice *parent_dev;
NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
if (priv->connection) {
@ -1153,11 +1147,7 @@ nm_vpn_connection_get_ip6_route_metric (NMVpnConnection *connection)
return route_metric;
}
if ( priv->ip_ifindex
|| !(parent_dev = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (connection))))
return NM_VPN_ROUTE_METRIC_DEFAULT;
return nm_device_get_ip6_route_metric (parent_dev);
return NM_VPN_ROUTE_METRIC_DEFAULT;
}
static void