]> git.ipfire.org Git - thirdparty/nftables.git/commit
libnftables: always initialize netlink socket in nft_ctx_new()
authorThomas Haller <thaller@redhat.com>
Mon, 10 Jul 2023 08:45:16 +0000 (10:45 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Jul 2023 16:21:19 +0000 (18:21 +0200)
commit057f5ffe7dd500a379ca882cfec699d52bfa40a1
treeda646e79c4b1706399dc684adc2258db62d40fff
parent668c18f672038dffa72b67d834445e0fe5ae286d
libnftables: always initialize netlink socket in nft_ctx_new()

nft_ctx_new() has a flags argument, but currently no flags are
supported. The documentation suggests to pass 0 (NFT_CTX_DEFAULT).

Initializing the netlink socket happens by default already, we should do
it for all flags. Also because  nft_ctx_netlink_init() is not public
API so it's not clear how the user gets a functioning context instance
otherwise.

If we ever want to not initialize the netlink socket for a context
instance, then there should be a dedicated flag for doing that (and
additional API for making that mode of operation usable).

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/libnftables.c