device: don't enforce IP cleanup on deactivating state

Don't enforce IP cleanup when devices are in deactivating state, to
make sure that network connection is still available for pre-down
dispatcher phase.

Fixes ac4e63ddda ('ip: support dhcp-send-release in NMSettingIpConfig')

https://bugzilla.suse.com/show_bug.cgi?id=1228154
(cherry picked from commit c61c552077)
This commit is contained in:
Jonathan Kang 2024-08-20 15:50:13 +08:00 committed by Fernando Fernandez Mancera
parent c976e21237
commit 4e1a93ecbc

View file

@ -16893,10 +16893,6 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
_cleanup_ip_pre(self, AF_INET6, CLEANUP_TYPE_DECONFIGURE, FALSE);
}
break;
case NM_DEVICE_STATE_DEACTIVATING:
/* If we are now deactivating we should enforce IP cleanup. */
_cleanup_ip_pre(self, AF_INET, CLEANUP_TYPE_DECONFIGURE, FALSE);
_cleanup_ip_pre(self, AF_INET6, CLEANUP_TYPE_DECONFIGURE, FALSE);
default:
break;
}