From: Eric Leblond Date: Wed, 2 Oct 2013 23:08:08 +0000 (+0200) Subject: netlink: fix nft flush operation X-Git-Tag: v0.099~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bd599c66b05c4b8bba2564b3f4cd77e719a660c;p=thirdparty%2Fnftables.git netlink: fix nft flush operation nft_netlink function is already calling mnl_batch_end and mnl_batch_begin so it is not necessary to do it in the netlink_flush_rules function. Doing this result in a invalid netlink message which is discarded by the kernel. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/netlink.c b/src/netlink.c index f75cef763..a62c35722 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -456,10 +456,8 @@ static int netlink_flush_rules(struct netlink_ctx *ctx, const struct handle *h, strerror(errno)); ctx->data = h; - mnl_batch_begin(); nft_rule_list_foreach(rule_cache, flush_rule_cb, ctx); nft_rule_list_free(rule_cache); - mnl_batch_end(); return 0; }