diff options
author | Wen Liang <liangwen12year@gmail.com> | 2022-02-15 14:00:18 -0500 |
---|---|---|
committer | Wen Liang <liangwen12year@gmail.com> | 2022-02-24 07:53:48 -0500 |
commit | 58496e5f82cfbb33eb1a86c82a0cc4a328e34ab6 (patch) | |
tree | 9254f68c74debce60320510cb58825bc490bd337 | |
parent | 355f7c63ded42bfbe8bb572e8579bab2ce31b114 (diff) |
device: commit the l3cd changes via l3cfg during cleanup
After the first time committing, the routes and addresses are removed
directly by bypassing the l3cfg in `nm_device_cleanup()`, then when
committing the second time, the l3cfg think that some addresses are
still configured but they are actually already disappeared from the
kernel already.
To fix it, commit the l3cd changes through l3cfg instead of removing
the addresses/routes directly.
https://bugzilla.redhat.com/show_bug.cgi?id=2043514
Fixes-test: @nmcli_general_activate_static_connection_carrier_not_ignored
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1115
(cherry picked from commit 9f6114afe884fc56d19bbfbdf22a0b68d907d0cd)
-rw-r--r-- | src/core/devices/nm-device.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index aed580ab6e..35360ceebb 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -15076,8 +15076,7 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu if (ifindex > 0) { NMPlatform *platform = nm_device_get_platform(self); - nm_platform_ip_route_flush(platform, AF_UNSPEC, ifindex); - nm_platform_ip_address_flush(platform, AF_UNSPEC, ifindex); + nm_device_l3cfg_commit(self, NM_L3_CFG_COMMIT_TYPE_REAPPLY, TRUE); if (nm_device_get_applied_setting(self, NM_TYPE_SETTING_TC_CONFIG)) { nm_platform_tc_sync(platform, ifindex, NULL, NULL); |