From 926ba925ec52f7bf7176627005de15a13a1bde24 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 16 May 2016 09:36:09 +0200 Subject: [PATCH] core: fix creation of NMSettingIPConfig routes Since commit 4c2410bc92e8 ("platform: extend NMIPConfigSource to preserve the rtm_protocol field") the rt_source field of a NMPlatformIP{4,6}Route contains the RTPROT value read from kernel. Update checks on route source, otherwise existing routes are not picked up when a generated connection is created, breaking the connection matching. Fixes: 4c2410bc92e8f5b30c826bed8392ecc05a7e8fe2 --- src/nm-ip4-config.c | 2 +- src/nm-ip6-config.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 56c8a4ef3b..73c3cfd6fc 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -632,7 +632,7 @@ nm_ip4_config_create_setting (const NMIP4Config *config) continue; /* Ignore routes provided by external sources */ - if (route->rt_source != NM_IP_CONFIG_SOURCE_USER) + if (route->rt_source != nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER)) continue; s_route = nm_ip_route_new_binary (AF_INET, diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index e525c10287..062b8c6616 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -28,6 +28,7 @@ #include "nm-utils.h" #include "nm-platform.h" +#include "nm-platform-utils.h" #include "nm-route-manager.h" #include "nm-core-internal.h" #include "NetworkManagerUtils.h" @@ -621,7 +622,7 @@ nm_ip6_config_create_setting (const NMIP6Config *config) continue; /* Ignore routes provided by external sources */ - if (route->rt_source != NM_IP_CONFIG_SOURCE_USER) + if (route->rt_source != nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER)) continue; s_route = nm_ip_route_new_binary (AF_INET6,