summaryrefslogtreecommitdiff
path: root/src/devices
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-12 11:22:01 +0100
committerThomas Haller <thaller@redhat.com>2014-11-19 22:55:32 +0100
commit462456f2554163f15037305c3b5320028476bd36 (patch)
treecda16f32ab1fb717c4c8ebd86c94ed31032f2cde /src/devices
parent393f213c3bad9935e25652dade02237578562f17 (diff)
downloadNetworkManager-462456f2554163f15037305c3b5320028476bd36.tar.gz
policy: remove redundant remove_default_route() functions from NMDefaultRouteManager
When calling update_default_route(), NMDefaultRouteManager will look at the source, and determine whether it has a default route or not. For example for device sources, this means calling nm_device_get_ip4_default_route(). If the source indicates that it has no default route, the effect of calling update_default_route() is the same as calling remove_default_route() (hence, remove() can be replaced by update()). If the source however still indicates a default route, the behavior would be different. This case would be an undesired inconsistancy, because source and NMDefaultRouteManager would disagree of whether the source has a default route. Source must always properly indicate whether it has a default route or not, hence this situation does not arise. Hence it is always better to call update(). Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/nm-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 864a7d57bd..a533048c62 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6935,8 +6935,8 @@ _cleanup_generic_post (NMDevice *self, gboolean deconfigure)
priv->default_route.v4_has = FALSE;
priv->default_route.v6_has = FALSE;
- nm_default_route_manager_ip4_remove_default_route (nm_default_route_manager_get (), self);
- nm_default_route_manager_ip6_remove_default_route (nm_default_route_manager_get (), self);
+ nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
+ nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
/* Clean up IP configs; this does not actually deconfigure the
* interface; the caller must flush routes and addresses explicitly.