summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-10-19 00:35:24 +0200
committerThomas Haller <thaller@redhat.com>2014-11-07 15:23:12 +0100
commit276424c881c25cecff60895d034a4919033d0537 (patch)
treeab927a8dedc907188efd77739a9dde41071ac588
parentf5c0646e1c0807aa4379ddde820a675e48c2f4bd (diff)
downloadNetworkManager-276424c881c25cecff60895d034a4919033d0537.tar.gz
core: remove unneeded check in nm_ip4_config_commit() for default routes
These lines are part of NM for a very long time. I think they are wrong, because the default route is not added to the NMIP4Config/NMIP6Config objects. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/nm-ip4-config.c7
-rw-r--r--src/nm-ip6-config.c7
-rw-r--r--src/platform/nm-platform.c10
3 files changed, 4 insertions, 20 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index a781f0342c..3566b68569 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -278,13 +278,6 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex)
&& nm_ip4_config_destination_is_direct (config, route->network, route->plen))
continue;
- /* Don't add the default route if the connection
- * is never supposed to be the default connection.
- */
- if ( nm_ip4_config_get_never_default (config)
- && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
- continue;
-
g_array_append_vals (routes, route, 1);
}
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index d901781ba4..3b0f291a91 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -391,13 +391,6 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
&& nm_ip6_config_destination_is_direct (config, &route->network, route->plen))
continue;
- /* Don't add the default route if the connection
- * is never supposed to be the default connection.
- */
- if ( nm_ip6_config_get_never_default (config)
- && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route))
- continue;
-
g_array_append_vals (routes, route, 1);
}
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 07e9979692..8edf46f75c 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -2010,9 +2010,8 @@ array_contains_ip6_route (const GArray *routes, const NMPlatformIP6Route *route)
* A convenience function to synchronize routes for a specific interface
* with the least possible disturbance. It simply removes routes that are
* not listed and adds routes that are.
- *
- * @known_routes should not contain a default route; if it does, it will be
- * ignored.
+ * Default routes are ignored (both in @known_routes and those already
+ * configured on the device).
*
* Returns: %TRUE on success.
*/
@@ -2083,9 +2082,8 @@ nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes)
* A convenience function to synchronize routes for a specific interface
* with the least possible disturbance. It simply removes routes that are
* not listed and adds routes that are.
- *
- * @known_routes should not contain a default route; if it does, it will be
- * ignored.
+ * Default routes are ignored (both in @known_routes and those already
+ * configured on the device).
*
* Returns: %TRUE on success.
*/