From patchwork Fri Aug 9 11:11:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alvaro Neira X-Patchwork-Id: 265990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8FAE52C00A2 for ; Fri, 9 Aug 2013 21:12:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967646Ab3HILMB (ORCPT ); Fri, 9 Aug 2013 07:12:01 -0400 Received: from mail-we0-f181.google.com ([74.125.82.181]:47644 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967445Ab3HILMA (ORCPT ); Fri, 9 Aug 2013 07:12:00 -0400 Received: by mail-we0-f181.google.com with SMTP id p58so2591364wes.12 for ; Fri, 09 Aug 2013 04:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:from:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=3XSi6G40mBtzPQJBBZQVC5EdOt84qTJWwUGtEFi5PaE=; b=QdfDsFCISBxEa5hnpMgEEMBHDg3pSosG3XAf5MfRcdxsjljhtwM0ZY58zAov9LACNu TTz0pDdhIwfBM20Yq3h2tdluCXwjJr8uiafQ9bNQ+KO8Y4HJacpYY7uEko0/T8iac/mC A/jSkJFjsqyUnczP7gmV1iTKNrxycSQ1lSTV56Oj3ebBp4eESId/ec1h+Y8Zg3GqnpLS Asg4UIgvy5IkDwSEYGA0iKZ3SpZWZLzLtCQQyOL9favnHrNUKHZgA9q3VgOJ21FtJcVd TSm7iGQK4TkLqqnLoMSG1THFvyIl/tWjbtPdy0fWoyNjgF3YBRfbEmvE+AHfP28Z/hUs wpyw== X-Received: by 10.194.104.170 with SMTP id gf10mr5672691wjb.90.1376046719352; Fri, 09 Aug 2013 04:11:59 -0700 (PDT) Received: from [127.0.1.1] ([90.174.0.186]) by mx.google.com with ESMTPSA id ee5sm2185749wib.3.2013.08.09.04.11.55 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 04:11:58 -0700 (PDT) Subject: [libnftables PATCH 01/13] src: expr: missing commas in json output support To: netfilter-devel@vger.kernel.org From: Alvaro Neira Cc: eric@regit.org Date: Fri, 09 Aug 2013 13:11:48 +0200 Message-ID: <20130809111148.29819.95689.stgit@Ph0enix> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Álvaro Neira Ayuso Added missing commas in json output support Signed-off-by: Alvaro Neira Ayuso --- src/expr/meta.c | 2 +- src/expr/nat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);