diff options
author | Thomas Haller <thaller@redhat.com> | 2014-11-04 17:28:22 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-07 15:23:12 +0100 |
commit | 6e409ef91f2da4905118816bfd708e718bc4292e (patch) | |
tree | cf176dbf19826f88f32bdfbb393c05fb993c75a7 /src/nm-policy.c | |
parent | f22c72d29946ce25b87c3265edbd8a230f50fd55 (diff) | |
download | NetworkManager-6e409ef91f2da4905118816bfd708e718bc4292e.tar.gz |
policy: return best config based on the internal sorting of NMDefaultRouteManager
Now that both VPN and devices are managed (and ordered) by
NMDefaultRouteManager, refactor get_best_config() to use the
priority accordingly.
Before, we would first iterate over all VPN connections and
returning the best one. Only if no suitable VPN connection
was found, a best device would be returned.
Modify get_best_config() to treat VPN and device the same and
return the best one based on the route metric.
With this change, get_best_config() gives consistent results
together with get_best_device(). Also, you can configure
that a device gets a higher priority then a VPN.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src/nm-policy.c')
-rw-r--r-- | src/nm-policy.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c index e31ba13e11..963be3099b 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -386,12 +386,8 @@ get_best_ip4_config (NMPolicy *self, NMDevice **out_device, NMVpnConnection **out_vpn) { - NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); - return nm_default_route_manager_ip4_get_best_config (nm_default_route_manager_get (), - priv->manager, ignore_never_default, - priv->default_device4, out_ip_iface, out_ac, out_device, @@ -485,12 +481,8 @@ get_best_ip6_config (NMPolicy *self, NMDevice **out_device, NMVpnConnection **out_vpn) { - NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); - return nm_default_route_manager_ip6_get_best_config (nm_default_route_manager_get (), - priv->manager, ignore_never_default, - priv->default_device6, out_ip_iface, out_ac, out_device, |