summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-05-07 16:25:04 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-05-08 10:06:57 +0200
commit0a15cb2040ee94a33ddf4413e9f2e95356d6acd6 (patch)
treef349b3c1ad8bd44d19e39c8711be0403d9cc4255 /src/devices/nm-device.c
parent0f23f2871b28ede3060e45fb17c1b2597417d037 (diff)
downloadNetworkManager-0a15cb2040ee94a33ddf4413e9f2e95356d6acd6.tar.gz
device: unconditionally reapply IP configuration on link up
Consider the situation in which ipv4.method=auto and there is an address configured. Also, the DHCP timeout is long and there is no DHCP server. If the link is brought down temporarily, the prefix route for the static address is lost and not restored by NM because we reapply the IP configuration only when the IP state is DONE. The same can happen also for IPv6, but in that case also static IPv6 addresses are lost. We should always reapply the IP configuration when the link goes up.
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 0f8fda2c3d..41fc32288f 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3890,16 +3890,12 @@ device_link_changed (NMDevice *self)
if (priv->up && (!was_up || seen_down)) {
/* the link was down and just came up. That happens for example, while changing MTU.
* We must restore IP configuration. */
- if (priv->ip_state_4 == NM_DEVICE_IP_STATE_DONE) {
- if (!ip_config_merge_and_apply (self, AF_INET, TRUE))
- _LOGW (LOGD_IP4, "failed applying IP4 config after link comes up again");
- }
+ if (!ip_config_merge_and_apply (self, AF_INET, TRUE))
+ _LOGW (LOGD_IP4, "failed applying IP4 config after link comes up again");
priv->linklocal6_dad_counter = 0;
- if (priv->ip_state_6 == NM_DEVICE_IP_STATE_DONE) {
- if (!ip_config_merge_and_apply (self, AF_INET6, TRUE))
- _LOGW (LOGD_IP6, "failed applying IP6 config after link comes up again");
- }
+ if (!ip_config_merge_and_apply (self, AF_INET6, TRUE))
+ _LOGW (LOGD_IP6, "failed applying IP6 config after link comes up again");
}
if (update_unmanaged_specs)