summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-06 22:02:19 +0100
committerThomas Haller <thaller@redhat.com>2014-11-07 15:23:12 +0100
commitcc9fad612e4885cee7099bda8c4ff21ef661ebaa (patch)
treed02a7d2ea9a9ff818d0a3878a45b36dddf686a8b
parent2f90ecbfbb15c8ed2a4103083864f951274b8214 (diff)
downloadNetworkManager-cc9fad612e4885cee7099bda8c4ff21ef661ebaa.tar.gz
policy: remove redundant check for never-default in get_best_ipx_config()
get_best_ip4_config() and get_best_ip6_config() checked both for never-default of the setting. This check was redundant, because the never-default value was already merged into NMIPXConfig. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/nm-policy.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 1a12ea2777..73f3bf4846 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -541,7 +541,6 @@ get_best_ip4_config (NMPolicy *policy,
NMVpnConnection *candidate;
NMIP4Config *vpn_ip4;
NMConnection *tmp;
- NMSettingIPConfig *s_ip4;
NMVpnConnectionState vpn_state;
if (!NM_IS_VPN_CONNECTION (active))
@@ -560,16 +559,8 @@ get_best_ip4_config (NMPolicy *policy,
if (!vpn_ip4)
continue;
- if (ignore_never_default == FALSE) {
- /* Check for a VPN-provided config never-default */
- if (nm_ip4_config_get_never_default (vpn_ip4))
- continue;
-
- /* Check the user's preference from the NMConnection */
- s_ip4 = nm_connection_get_setting_ip4_config (tmp);
- if (nm_setting_ip_config_get_never_default (s_ip4))
- continue;
- }
+ if (!ignore_never_default && nm_ip4_config_get_never_default (vpn_ip4))
+ continue;
ip4_config = vpn_ip4;
if (out_vpn)
@@ -752,7 +743,6 @@ get_best_ip6_config (NMPolicy *policy,
NMVpnConnection *candidate;
NMIP6Config *vpn_ip6;
NMConnection *tmp;
- NMSettingIPConfig *s_ip6;
NMVpnConnectionState vpn_state;
if (!NM_IS_VPN_CONNECTION (active))
@@ -771,16 +761,8 @@ get_best_ip6_config (NMPolicy *policy,
if (!vpn_ip6)
continue;
- if (ignore_never_default == FALSE) {
- /* Check for a VPN-provided config never-default */
- if (nm_ip6_config_get_never_default (vpn_ip6))
- continue;
-
- /* Check the user's preference from the NMConnection */
- s_ip6 = nm_connection_get_setting_ip6_config (tmp);
- if (nm_setting_ip_config_get_never_default (s_ip6))
- continue;
- }
+ if (!ignore_never_default && nm_ip6_config_get_never_default (vpn_ip6))
+ continue;
ip6_config = vpn_ip6;
if (out_vpn)