From 9f195559d29f697e6dce40bc99f251c770196325 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 8 May 2014 14:56:59 -0400 Subject: [PATCH] core: look at route sources when assuming a connection When generating an NMConnection to match the current state of a device, don't add its RA-provided and DHCP-provided routes to the NMSettingIP4Config/NMSettingIP6Config, since those routes didn't come from the connection profile before. https://bugzilla.gnome.org/show_bug.cgi?id=729203 --- src/nm-ip4-config.c | 4 ++++ src/nm-ip6-config.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 26a6ead719..6a7904328a 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -444,6 +444,10 @@ nm_ip4_config_create_setting (const NMIP4Config *config) if (!route->plen) continue; + /* Ignore routes provided by external sources */ + if (route->source != NM_PLATFORM_SOURCE_USER) + continue; + s_route = nm_ip4_route_new (); nm_ip4_route_set_dest (s_route, route->network); nm_ip4_route_set_prefix (s_route, route->plen); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 26b0530630..66fa395352 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -551,6 +551,10 @@ nm_ip6_config_create_setting (const NMIP6Config *config) if (!route->plen) continue; + /* Ignore routes provided by external sources */ + if (route->source != NM_PLATFORM_SOURCE_USER) + continue; + s_route = nm_ip6_route_new (); nm_ip6_route_set_dest (s_route, &route->network); nm_ip6_route_set_prefix (s_route, route->plen);