Skip to contentSkip to conversation

examples: nft-table-add: fix wrong buffer pointer

PATCH Applied Arturo Borrero Gonzalez 2 participants 2 messages Sep 29, 2014 – Sep 30, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples: nft-table-add: fix wrong buffer pointer

We should point to the batch buffer as returned by the libmnl helper.

---
 examples/nft-table-add.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
examples/nft-table-add.c +2 -1
index 828091e..9340128 100644
@@ -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);
maintainer Applied
#1 lore raw
Quoted 1 line · Arturo Borrero Gonzalez

We should point to the batch buffer as returned by the libmnl helper.

Applied, thanks.