diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 87fcb5ff61..696c0df886 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -9298,9 +9298,6 @@ _routing_rules_sync(NMDevice *self, NMTernary set_mode) int is_ipv4; untrack_only_dirty = TRUE; - nmp_route_manager_set_dirty(route_manager, user_tag_1); - if (klass->get_extra_rules) - nmp_route_manager_set_dirty(route_manager, user_tag_2); applied_connection = nm_device_get_applied_connection(self); @@ -9347,9 +9344,9 @@ _routing_rules_sync(NMDevice *self, NMTernary set_mode) } } - nmp_route_manager_untrack_all(route_manager, user_tag_1, !untrack_only_dirty); + nmp_route_manager_untrack_all(route_manager, user_tag_1, !untrack_only_dirty, TRUE); if (klass->get_extra_rules) - nmp_route_manager_untrack_all(route_manager, user_tag_2, !untrack_only_dirty); + nmp_route_manager_untrack_all(route_manager, user_tag_2, !untrack_only_dirty, TRUE); keep_deleted_rules = FALSE; if (set_mode == NM_TERNARY_DEFAULT) { diff --git a/src/libnm-platform/nmp-route-manager.c b/src/libnm-platform/nmp-route-manager.c index c5ca02600c..c31c9806a5 100644 --- a/src/libnm-platform/nmp-route-manager.c +++ b/src/libnm-platform/nmp-route-manager.c @@ -514,7 +514,8 @@ nmp_route_manager_set_dirty(NMPRouteManager *self, gconstpointer user_tag) gboolean nmp_route_manager_untrack_all(NMPRouteManager *self, gconstpointer user_tag, - gboolean all /* or only dirty */) + gboolean all /* or only dirty */, + gboolean make_survivors_dirty) { TrackData *track_data; TrackData *track_data_safe; @@ -535,7 +536,10 @@ nmp_route_manager_untrack_all(NMPRouteManager *self, if (all || track_data->dirty) { _track_data_untrack(self, track_data, FALSE, FALSE); changed = TRUE; + continue; } + if (make_survivors_dirty) + track_data->dirty = TRUE; } if (c_list_is_empty(&user_tag_data->user_tag_lst_head)) g_hash_table_remove(self->by_user_tag, user_tag_data); diff --git a/src/libnm-platform/nmp-route-manager.h b/src/libnm-platform/nmp-route-manager.h index a61a68ca98..97ec3840df 100644 --- a/src/libnm-platform/nmp-route-manager.h +++ b/src/libnm-platform/nmp-route-manager.h @@ -69,7 +69,8 @@ void nmp_route_manager_set_dirty(NMPRouteManager *self, gconstpointer user_tag); gboolean nmp_route_manager_untrack_all(NMPRouteManager *self, gconstpointer user_tag, - gboolean all /* or only dirty */); + gboolean all /* or only dirty */, + gboolean make_survivors_dirty); void nmp_route_manager_sync(NMPRouteManager *self, NMPObjectType obj_type, gboolean keep_deleted);