core: don't suppress host route to gateway in ip-config caputure

Why would we do this? The route is there, so, add it.
This revises commit 4fba2260f3
which added this check for matching generated connections.
I don't think this is still necessary, and if it is, then
the matching should be relaxed instead. It's bad to hide
routes from NMIP4Config/NMIP6Config, because those routes are
also exported via D-Bus.
This commit is contained in:
Thomas Haller 2017-08-23 14:43:15 +02:00
parent 10ac675299
commit e470e13922
2 changed files with 10 additions and 19 deletions

View file

@ -681,16 +681,6 @@ nm_ip4_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
continue;
if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
continue;
if ( priv->has_gateway
&& route->plen == 32
&& route->network == priv->gateway
&& route->gateway == 0) {
/* If there is a host route to the gateway, ignore that route. It is
* automatically added by NetworkManager when needed.
*/
continue;
}
_add_route (self, plobj, NULL);
}
@ -928,6 +918,11 @@ nm_ip4_config_merge_setting (NMIP4Config *self, NMSettingIPConfig *setting, guin
NMIPRoute *s_route = nm_setting_ip_config_get_route (setting, i);
NMPlatformIP4Route route;
if (nm_ip_route_get_family (s_route) != AF_INET) {
nm_assert_not_reached ();
continue;
}
memset (&route, 0, sizeof (route));
nm_ip_route_get_dest_binary (s_route, &route.network);

View file

@ -483,15 +483,6 @@ nm_ip6_config_capture (NMDedupMultiIndex *multi_idx, NMPlatform *platform, int i
if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
continue;
if ( has_gateway
&& route->plen == 128
&& IN6_ARE_ADDR_EQUAL (&route->network, &priv->gateway)
&& IN6_IS_ADDR_UNSPECIFIED (&route->gateway)) {
/* If there is a host route to the gateway, ignore that route. It is
* automatically added by NetworkManager when needed.
*/
continue;
}
_add_route (self, plobj, NULL);
}
@ -656,6 +647,11 @@ nm_ip6_config_merge_setting (NMIP6Config *self, NMSettingIPConfig *setting, guin
NMIPRoute *s_route = nm_setting_ip_config_get_route (setting, i);
NMPlatformIP6Route route;
if (nm_ip_route_get_family (s_route) != AF_INET6) {
nm_assert_not_reached ();
continue;
}
memset (&route, 0, sizeof (route));
nm_ip_route_get_dest_binary (s_route, &route.network);