diff options
author | Thomas Haller <thaller@redhat.com> | 2014-11-26 17:58:29 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-26 19:25:12 +0100 |
commit | 3210bb93a10303ee701d2f2eea96855c57ccfce8 (patch) | |
tree | 2fed42f41fa7e2fe7884b8232f9c181ac5ae93e8 /src | |
parent | 382906c39130b1943c179643980645c71cd0d4a1 (diff) | |
download | NetworkManager-3210bb93a10303ee701d2f2eea96855c57ccfce8.tar.gz |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/vpn-manager/nm-vpn-connection.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index adb287cb04..cb07c7f9ad 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -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 |