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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

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);

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




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux