]> git.ipfire.org Git - thirdparty/nftables.git/commit
libnftables: get rid of repeated initialization of netlink_ctx
authorJeremy Sowden <jeremy@azazel.net>
Fri, 19 Jul 2019 11:10:09 +0000 (12:10 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 22 Jul 2019 21:27:36 +0000 (23:27 +0200)
commitfc6d0f8b0cb1895effd5248020906941d100d7b7
tree42f5cc829f0cb730a9be4b46a49c0fcb55f3195a
parent5d9dce41a72875396f1fddff30c770138d650c29
libnftables: get rid of repeated initialization of netlink_ctx

Most members in the context don't change, so there is no need to memset
it and reassign them on every iteration.  Moved that code out of the
loop.

Fixes: a72315d2bad4 ("src: add rule batching support")
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/libnftables.c