cache: properly invoke change_cb for deleted objects in nl_cache_resync()
When resyncing a cache, there are no delete messages, so they need to be synthesized for deleted objects. Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
52d6b8b9ee
commit
ba1bd9050d
1 changed files with 8 additions and 2 deletions
10
lib/cache.c
10
lib/cache.c
|
@ -605,9 +605,15 @@ int nl_cache_resync(struct nl_sock *sk, struct nl_cache *cache,
|
|||
if (err < 0)
|
||||
goto errout;
|
||||
|
||||
nl_list_for_each_entry_safe(obj, next, &cache->c_items, ce_list)
|
||||
if (nl_object_is_marked(obj))
|
||||
nl_list_for_each_entry_safe(obj, next, &cache->c_items, ce_list) {
|
||||
if (nl_object_is_marked(obj)) {
|
||||
nl_object_get(obj);
|
||||
nl_cache_remove(obj);
|
||||
if (change_cb)
|
||||
change_cb(cache, obj, NL_ACT_DEL);
|
||||
nl_object_put(obj);
|
||||
}
|
||||
}
|
||||
|
||||
NL_DBG(1, "Finished resyncing %p <%s>\n", cache, nl_cache_name(cache));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue