summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2014-11-17 10:26:41 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-11-17 12:56:25 +0100
commit49a9ff0b4da9c02145bab2448a01611014dfdd6e (patch)
tree7ae12bbab4506a5f91693b1b292b71d4f16675c5 /examples
parent6e39ecbf6aa6ca5f9a1fc999ea56bf8a5d29ea9e (diff)
examples: nft-rule-parse-add: fix wrong buffer usage when building rule header
The libmnl helper returns a pointer where to start putting the rule data. Reported-by: Ian Bishop <ian@pace7.com> Closes: http://bugzilla.netfilter.org/show_bug.cgi?id=983 Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/nft-rule-parse-add.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/nft-rule-parse-add.c b/examples/nft-rule-parse-add.c
index 4160435..75f5268 100644
--- a/examples/nft-rule-parse-add.c
+++ b/examples/nft-rule-parse-add.c
@@ -122,7 +122,8 @@ int main(int argc, char *argv[])
rule_seq = seq;
family = nft_rule_attr_get_u32(r, NFT_RULE_ATTR_FAMILY);
- nlh = nft_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, family,
+ nlh = nft_rule_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+ NFT_MSG_NEWRULE, family,
NLM_F_CREATE|NLM_F_APPEND|NLM_F_ACK,
seq++);
nft_rule_nlmsg_build_payload(nlh, r);