summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-01 13:53:36 +0200
committerThomas Haller <thaller@redhat.com>2017-09-08 11:05:05 +0200
commit7ab40b9e108f969dcc06b427a6d88e22f74f5e94 (patch)
treecce3c4ad33f09b6a6d41f0cc870e51e5b171073e
parent199499967a04b123f2a842a94bdb637c3ac74a76 (diff)
downloadNetworkManager-7ab40b9e108f969dcc06b427a6d88e22f74f5e94.tar.gz
core: ignore routes from non-main table in nm_ip4_config_capture()
and nm_ip6_config_capture().
-rw-r--r--src/nm-ip4-config.c5
-rw-r--r--src/nm-ip6-config.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 0603a4348d..1e0083ed0f 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -671,7 +671,8 @@ nm_ip4_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
nmp_cache_iter_for_each (&iter, head_entry, &plobj) {
const NMPlatformIP4Route *route = NMP_OBJECT_CAST_IP4_ROUTE (plobj);
- if ( NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)
+ if ( !route->table_coerced
+ && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)
&& route->rt_source != NM_IP_CONFIG_SOURCE_RTPROT_KERNEL) {
if (route->metric < lowest_metric) {
priv->gateway = route->gateway;
@@ -680,6 +681,8 @@ nm_ip4_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
priv->has_gateway = TRUE;
}
+ if (route->table_coerced)
+ continue;
if (route->rt_source == NM_IP_CONFIG_SOURCE_RTPROT_KERNEL)
continue;
if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index 5bc17cd18b..cbba554c87 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -463,7 +463,8 @@ nm_ip6_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
nmp_cache_iter_for_each (&iter, head_entry, &plobj) {
const NMPlatformIP6Route *route = NMP_OBJECT_CAST_IP6_ROUTE (plobj);
- if ( NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)
+ if ( !route->table_coerced
+ && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)
&& route->rt_source != NM_IP_CONFIG_SOURCE_RTPROT_KERNEL) {
if (route->metric < lowest_metric) {
priv->gateway = route->gateway;
@@ -472,6 +473,8 @@ nm_ip6_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
has_gateway = TRUE;
}
+ if (route->table_coerced)
+ continue;
if (route->rt_source == NM_IP_CONFIG_SOURCE_RTPROT_KERNEL)
continue;
if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))