[nftables,4/4] netlink: fix nft flush operation

Message ID 1380755288-17587-5-git-send-email-eric@regit.org
State Accepted
Headers show

Commit Message

Eric Leblond Oct. 2, 2013, 11:08 p.m.
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 <eric@regit.org>
 src/netlink.c | 2 --
 1 file changed, 2 deletions(-)


diff --git a/src/netlink.c b/src/netlink.c
index f75cef7..a62c357 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,
 	ctx->data = h;
-	mnl_batch_begin();
 	nft_rule_list_foreach(rule_cache, flush_rule_cb, ctx);
-	mnl_batch_end();
 	return 0;