diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-11-16 01:11:55 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2012-11-16 01:11:55 +0100 |
commit | 00132b46968fff7975eb8d20a307c626dfefe2f1 (patch) | |
tree | e2d6ea3d7535358435ea136019e03c35c22c19ba /lib/netfilter/queue_msg_obj.c | |
parent | 23c4ef67c735813fd41f66f6722b996d1ad7314a (diff) | |
download | libnl-00132b46968fff7975eb8d20a307c626dfefe2f1.tar.gz |
cache: provide safe variant of nl_cache_mngt_require() and use it
This makes runtime removal of cache operations possible if non-safe
API is not in use by application. The non-safe API will be removed
in the next major version.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/netfilter/queue_msg_obj.c')
-rw-r--r-- | lib/netfilter/queue_msg_obj.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/netfilter/queue_msg_obj.c b/lib/netfilter/queue_msg_obj.c index 33305ed..bfaafc5 100644 --- a/lib/netfilter/queue_msg_obj.c +++ b/lib/netfilter/queue_msg_obj.c @@ -66,7 +66,7 @@ static void nfnl_queue_msg_dump(struct nl_object *a, struct nl_dump_params *p) struct nl_cache *link_cache; char buf[64]; - link_cache = nl_cache_mngt_require("route/link"); + link_cache = nl_cache_mngt_require_safe("route/link"); nl_new_line(p); @@ -152,6 +152,9 @@ static void nfnl_queue_msg_dump(struct nl_object *a, struct nl_dump_params *p) buf, sizeof(buf))); nl_dump(p, "\n"); + + if (link_cache) + nl_cache_put(link_cache); } /** |