[libnftables PATCH 01/13] src: expr: missing commas in json output support

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

 



From: Álvaro Neira Ayuso <alvaroneay@xxxxxxxxx>

Added missing commas in json output support

Signed-off-by: Alvaro Neira Ayuso <alvaroneay@xxxxxxxxx>
---
 src/expr/meta.c |    2 +-
 src/expr/nat.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/expr/meta.c b/src/expr/meta.c
index ac01732..8f163f6 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -208,7 +208,7 @@ nft_rule_expr_meta_snprintf(char *buf, size_t len, uint32_t type,
 				meta->dreg, meta_key2str(meta->key));
 	case NFT_RULE_O_JSON:
 		return snprintf(buf, len, "\"dreg\" : %u, "
-					  "\"key\" : %s",
+					  "\"key\" : \"%s\"",
 				meta->dreg, meta_key2str(meta->key));
 	default:
 		break;
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 4b7ec27..654d4d7 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -262,7 +262,7 @@ nft_rule_expr_nat_snprintf_json(char *buf, size_t size,
 	if (nat->type == NFT_NAT_SNAT)
 		ret = snprintf(buf, len, "\"nat_type\" : \"snat\", ");
 	else if (nat->type == NFT_NAT_DNAT)
-		ret = snprintf(buf, len, "\nat_type\" : \"dnat\", ");
+		ret = snprintf(buf, len, "\"nat_type\" : \"dnat\", ");
 
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 

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