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
This commit is contained in:
Dan Winship 2014-05-08 14:56:59 -04:00
parent 662ade1e47
commit 9f195559d2
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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);