diff options
author | Thomas Haller <thaller@redhat.com> | 2024-05-06 09:58:25 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-05-06 09:59:34 (GMT) |
commit | 32cb9f392c77aa4b8ea0a05f6876021a4816814d (patch) | |
tree | 1faa16461bae76dd20b7bfaee3d7235f9bacfc06 /include | |
parent | 1dbdc30a6b9f96355aadf69899f124480aa4d374 (diff) | |
download | libnl-32cb9f392c77aa4b8ea0a05f6876021a4816814d.zip libnl-32cb9f392c77aa4b8ea0a05f6876021a4816814d.tar.gz libnl-32cb9f392c77aa4b8ea0a05f6876021a4816814d.tar.bz2 |
cache: cleanup nl_cache_mngr_alloc_ex()
- mngr->cm_flags must be set together when assigning the socket.
Otherwise, a `goto errout` in the middle will cause a leak.
- normalize the flags variable to not contain unexpected values.
- NL_ALLOCATED_SYNC_SOCK is private API. No need to expose that to
public headers.
Fixes: 1dbdc30a6b9f ('cache: allow to allocate cache manager with custom refill socket')
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/cache.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/netlink/cache.h b/include/netlink/cache.h index faa61a7..955f979 100644 --- a/include/netlink/cache.h +++ b/include/netlink/cache.h @@ -142,15 +142,14 @@ struct nl_cache_mngr; #define NL_AUTO_PROVIDE 1 #define NL_ALLOCATED_SOCK 2 /* For internal use only, do not use */ -#define NL_ALLOCATED_SYNC_SOCK 4 /* For internal use only, do not use */ extern int nl_cache_mngr_alloc(struct nl_sock *, int, int, struct nl_cache_mngr **); extern int nl_cache_mngr_alloc_ex(struct nl_sock *, - struct nl_sock *, - int, int, - struct nl_cache_mngr **); + struct nl_sock *, + int, int, + struct nl_cache_mngr **); extern int nl_cache_mngr_add(struct nl_cache_mngr *, const char *, change_func_t, |