summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-14 12:09:31 +0100
committerThomas Haller <thaller@redhat.com>2014-11-19 17:37:27 +0100
commit259e82b717ef5fcfd61ab584e2e2a3846b118250 (patch)
tree0ebcc23e84b180b855b760ec8462dbb1a7c48e13
parent10a840c798131e3c2d6f4d7cbf598f0dc2566c0b (diff)
downloadNetworkManager-259e82b717ef5fcfd61ab584e2e2a3846b118250.tar.gz
fixup! device: only add default route when having any addresses
-rw-r--r--src/devices/nm-device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 343f8a478d..b505f3ed74 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2810,8 +2810,8 @@ ip4_config_merge_and_apply (NMDevice *self,
if (assumed)
priv->default_route.v4_has = _device_get_default_route_from_platform (self, AF_INET, (NMPlatformIPRoute *) route);
- else if ( priv->ext_ip4_config_had_any_addresses
- || (commit && nm_ip4_config_get_num_addresses (composite))) {
+ else if ( (!commit && priv->ext_ip4_config_had_any_addresses)
+ || ( commit && nm_ip4_config_get_num_addresses (composite))) {
/* For managed interfaces, we can only configure a gateway, if either the external config indicates
* that we already have addresses, or if we are about to commit any addresses.
* Otherwise adding a default route will fail, because NMDefaultRouteManager does not add any
@@ -3364,8 +3364,8 @@ ip6_config_merge_and_apply (NMDevice *self,
if (assumed)
priv->default_route.v6_has = _device_get_default_route_from_platform (self, AF_INET6, (NMPlatformIPRoute *) route);
- else if ( priv->ext_ip6_config_had_any_addresses
- || (commit && nm_ip6_config_get_num_addresses (composite))) {
+ else if ( (!commit && priv->ext_ip6_config_had_any_addresses)
+ || ( commit && nm_ip6_config_get_num_addresses (composite))) {
/* For managed interfaces, we can only configure a gateway, if either the external config indicates
* that we already have addresses, or if we are about to commit any addresses.
* Otherwise adding a default route will fail, because NMDefaultRouteManager does not add any