summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/cache.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/cache.c b/lib/cache.c
index 2b24946..e0e845d 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -824,8 +824,15 @@ void nl_cache_foreach_filter(struct nl_cache *cache, struct nl_object *filter,
ops = cache->c_ops->co_obj_ops;
nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) {
- if (filter && !nl_object_match_filter(obj, filter))
- continue;
+ if (filter) {
+ int diff = nl_object_match_filter(obj, filter);
+
+ NL_DBG(3, "%p<->%p object difference: %x\n",
+ obj, filter, diff);
+
+ if (!diff)
+ continue;
+ }
cb(obj, arg);
}