diff mbox

[libnftnl] examples: nft-table-add: fix wrong buffer pointer

Message ID 20140929204104.16927.59891.stgit@nfdev.cica.es
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Arturo Borrero Sept. 29, 2014, 8:41 p.m. UTC
We should point to the batch buffer as returned by the libmnl helper.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 examples/nft-table-add.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso Sept. 30, 2014, 9:02 a.m. UTC | #1
On Mon, Sep 29, 2014 at 10:41:05PM +0200, Arturo Borrero Gonzalez wrote:
> We should point to the batch buffer as returned by the libmnl helper.

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/examples/nft-table-add.c b/examples/nft-table-add.c
index 828091e..9340128 100644
--- a/examples/nft-table-add.c
+++ b/examples/nft-table-add.c
@@ -85,7 +85,8 @@  int main(int argc, char *argv[])
 
 	table_seq = seq;
 	family = nft_table_attr_get_u32(t, NFT_TABLE_ATTR_FAMILY);
-	nlh = nft_table_nlmsg_build_hdr(buf, NFT_MSG_NEWTABLE, family,
+	nlh = nft_table_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+					NFT_MSG_NEWTABLE, family,
 					NLM_F_ACK, seq++);
 	nft_table_nlmsg_build_payload(nlh, t);
 	nft_table_free(t);