summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@bisdn.de>2024-04-26 16:32:21 +0200
committerThomas Haller <thaller@redhat.com>2024-04-26 19:32:40 +0200
commit3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1 (patch)
tree957beb26341ae5ee239686768ef2d728cb6fcc97
parent46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3 (diff)
downloadlibnl-upstream-main.tar.gz
cache: fix new object in callback v2 on updated objectsupstream-main
When calling the callback v2 for objects that were updated, we pass the update ("obj") instead of the updated object ("old") as new. Presumably this wasn't intended, so pass the updated object as new. This avoids weird updates where the new object is significantly smaller than the old one. E.g. for IPv6 multipath route updates, old would be the full route with all nexthops, while new would be a partial route with only the added/removed nexthop. Fixes: 66d032ad443a ("cache_mngr: add include callback v2") Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de> https://github.com/thom311/libnl/pull/381
-rw-r--r--lib/cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cache.c b/lib/cache.c
index dd059c11..bae641de 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -808,7 +808,7 @@ static int cache_include(struct nl_cache *cache, struct nl_object *obj,
*/
if (nl_object_update(old, obj) == 0) {
if (cb_v2) {
- cb_v2(cache, clone, obj, diff,
+ cb_v2(cache, clone, old, diff,
NL_ACT_CHANGE, data);
nl_object_put(clone);
} else if (cb)