diff options
author | Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> | 2013-06-26 13:37:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-27 19:53:13 +0200 |
commit | 354ba1187f757b77aac69efb853fc93591a9510a (patch) | |
tree | ab4c57e4092ac26dba2a31e704fe5012fed636fc /src | |
parent | 948cde9185713f97941e7bb5b41e4d6d7402ddf5 (diff) |
nat: snprintf: fix buffer offset
This patch fix the buffer offset necesary to print correctly the nat expr in a default output mode.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/expr/nat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr/nat.c b/src/expr/nat.c index 7050c23..89ab080 100644 --- a/src/expr/nat.c +++ b/src/expr/nat.c @@ -385,18 +385,18 @@ nft_rule_expr_nat_snprintf_default(char *buf, size_t size, break; } - ret = snprintf(buf, len, "family=%s ", nft_family2str(nat->family)); + ret = snprintf(buf+offset, len, "family=%s ", nft_family2str(nat->family)); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); if (e->flags & (1 << NFT_EXPR_NAT_REG_ADDR_MIN)) { - ret = snprintf(buf, len, + ret = snprintf(buf+offset, len, "sreg_addr_min_v4=%u sreg_addr_max_v4=%u ", nat->sreg_addr_min, nat->sreg_addr_max); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } if (e->flags & (1 << NFT_EXPR_NAT_REG_PROTO_MIN)) { - ret = snprintf(buf, len, + ret = snprintf(buf+offset, len, "sreg_proto_min=%u sreg_proto_max=%u ", nat->sreg_proto_min, nat->sreg_proto_max); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); |