core: clear sticky update flag when unmanaging a device

Sticky update flag forces a commit at UPDATE level after unmanaging
a device. As a result, all the link local addresses will be removed.
To prevent the commit after unmanaging a device, clear sticky update
flag.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2021-11-07 17:06:03 -05:00 committed by Beniamino Galvani
parent 655896f75b
commit 81ac02ae75
3 changed files with 18 additions and 0 deletions

View file

@ -3924,6 +3924,8 @@ _dev_l3_cfg_commit_type_reset(NMDevice *self)
do_set:
priv->l3cfg_commit_type =
nm_l3cfg_commit_type_register(priv->l3cfg, commit_type, priv->l3cfg_commit_type, "device");
if (commit_type == NM_L3_CFG_COMMIT_TYPE_NONE)
nm_l3cfg_commit_type_reset_update(priv->l3cfg);
}
/*****************************************************************************/

View file

@ -4310,6 +4310,20 @@ nm_l3cfg_commit_type_unregister(NML3Cfg *self, NML3CfgCommitTypeHandle *handle)
nm_g_slice_free(handle);
}
void
nm_l3cfg_commit_type_reset_update(NML3Cfg *self)
{
NML3CfgCommitTypeHandle *h;
c_list_for_each_entry (h, &self->priv.p->commit_type_lst_head, commit_type_lst) {
if (h->commit_type >= NM_L3_CFG_COMMIT_TYPE_UPDATE) {
return;
}
}
self->priv.p->commit_type_update_sticky = FALSE;
}
/*****************************************************************************/
const NML3ConfigData *

View file

@ -426,6 +426,8 @@ nm_l3cfg_commit_type_clear(NML3Cfg *self, NML3CfgCommitTypeHandle **handle)
return TRUE;
}
void nm_l3cfg_commit_type_reset_update(NML3Cfg *self);
/*****************************************************************************/
const NML3ConfigData *nm_l3cfg_get_combined_l3cd(NML3Cfg *self, gboolean get_commited);