diff options
author | Jonas Gorski <jonas.gorski@bisdn.de> | 2024-04-26 14:32:21 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-04-26 17:32:40 (GMT) |
commit | 3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1 (patch) | |
tree | 957beb26341ae5ee239686768ef2d728cb6fcc97 | |
parent | 46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3 (diff) | |
download | libnl-3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1.zip libnl-3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1.tar.gz libnl-3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1.tar.bz2 |
cache: fix new object in callback v2 on updated objects
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cache.c b/lib/cache.c index dd059c1..bae641d 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) |