From 94300c75fc3e113009e68e2ab9db91c31e99e9f4 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 20 Jan 2014 15:02:50 +0100 Subject: build: use libnftnl instead of libnftables in configure.in Signed-off-by: Pablo Neira Ayuso --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b38295f2..9f0d8945 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ fi AC_CHECK_LIB([mnl], [mnl_socket_open], , AC_MSG_ERROR([No suitable version of libmnl found])) -AC_CHECK_LIB([nftables], [nft_rule_alloc], , +AC_CHECK_LIB([nftnl], [nft_rule_alloc], , AC_MSG_ERROR([No suitable version of libnftnl found])) AC_CHECK_LIB([gmp], [__gmpz_init], , -- cgit v1.2.3 From 11ba3257796afbca42d9d6db7febf33f8cf90b92 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 20 Jan 2014 15:09:36 +0100 Subject: bump release number to 0.100 Signed-off-by: Pablo Neira Ayuso --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9f0d8945..b91bbac1 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ(2.61) AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy ]) -AC_INIT([nftables], [0.099], [netfilter-devel@vger.kernel.org]) +AC_INIT([nftables], [0.100], [netfilter-devel@vger.kernel.org]) AC_DEFINE([RELEASE_NAME], ["keith-alexander-filter"], [Release name]) AC_CONFIG_SRCDIR([src/rule.c]) -- cgit v1.2.3 From 35f689ec8726dc262834d1906609bab85cebf976 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 30 Jan 2014 16:44:58 +0100 Subject: mnl: fix inclusion of last rule in batch page This patch fixes the inclusion of the last rule that didn't fit into a batch page. When using sets this has manifested with the -EBUSY error when deleting the table (it was still containing unused sets after the flush). The following command line works fine here: nft -f test ; nft flush table filter ; nft delete chain filter output; nft delete table filter Tested using this kernel patch: http://patchwork.ozlabs.org/patch/314143/ Signed-off-by: Pablo Neira Ayuso --- src/mnl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mnl.c b/src/mnl.c index b8679022..a38a9ae2 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -98,12 +99,21 @@ struct batch_page { static void mnl_batch_page_add(void) { struct batch_page *batch_page; + struct nlmsghdr *last_nlh; + + /* Get the last message not fitting in the batch */ + last_nlh = mnl_nlmsg_batch_current(batch); batch_page = xmalloc(sizeof(struct batch_page)); batch_page->batch = batch; list_add_tail(&batch_page->head, &batch_page_list); batch_num_pages++; batch = mnl_batch_alloc(); + + /* Copy the last message not fitting to the new batch page */ + memcpy(mnl_nlmsg_batch_current(batch), last_nlh, last_nlh->nlmsg_len); + /* No overflow may happen as this is a new empty batch page */ + mnl_nlmsg_batch_next(batch); } static uint32_t mnl_batch_put(int type) -- cgit v1.2.3