summaryrefslogtreecommitdiffstats
path: root/examples/nft-table-add.c
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2014-09-29 22:41:05 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2014-09-30 11:02:07 +0200
commit0bff331b5586b995a5f7df81f8f7b290c96ac188 (patch)
treea431a3f4d1fcf20032e32b64fe1c3f3d37ebbb15 /examples/nft-table-add.c
parent743967a2284d975a5a1c3e9f8d7fa282fac9e671 (diff)
examples: nft-table-add: fix wrong buffer pointer
We should point to the batch buffer as returned by the libmnl helper. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/nft-table-add.c')
-rw-r--r--examples/nft-table-add.c3
1 files changed, 2 insertions, 1 deletions
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);