summaryrefslogtreecommitdiffstats
path: root/lib/fib_lookup/lookup.c
diff options
context:
space:
mode:
authorHolger Eitzenberger <holger@eitzenberger.org>2014-11-23 14:40:36 (GMT)
committerThomas Haller <thaller@redhat.com>2014-11-23 14:58:13 (GMT)
commit0020ba1212caad02841f72d680815e67d7180683 (patch)
treea38a4c76dfaffc7b17464735f5b2a2f445fe3f7f /lib/fib_lookup/lookup.c
parent15178401c264a348677db7a2d8cd041970a1ce72 (diff)
downloadlibnl-0020ba1212caad02841f72d680815e67d7180683.zip
libnl-0020ba1212caad02841f72d680815e67d7180683.tar.gz
libnl-0020ba1212caad02841f72d680815e67d7180683.tar.bz2
cache: avoid duplicate check on initial dump
The cache pickup does a check for duplicates for some time now. However, the pickup in nl_cache_refill() explicitely clears the cache, so the pickup doesn't need to actually do the dupe check, as uniqueness is already guaranteed be Netlink subsystem. And avoiding the dup check is beneficitial for performance reasons, as the current algorithm is O(n^2). http://lists.infradead.org/pipermail/libnl/2014-October/001680.html Fixes: 96bb7c9a4cdd10a2665c0f56120943e79e33c560 Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/fib_lookup/lookup.c')
-rw-r--r--lib/fib_lookup/lookup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fib_lookup/lookup.c b/lib/fib_lookup/lookup.c
index 3d07317..9b24635 100644
--- a/lib/fib_lookup/lookup.c
+++ b/lib/fib_lookup/lookup.c
@@ -270,7 +270,7 @@ int flnl_lookup(struct nl_sock *sk, struct flnl_request *req,
if (err < 0)
return err;
- return nl_cache_pickup(sk, cache);
+ return nl_cache_pickup_checkdup(sk, cache);
}
/** @} */