netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH 2/6] monitor: Fix printing of set declarations
Date: Tue, 25 Jul 2017 16:56:25 +0200	[thread overview]
Message-ID: <20170725145629.20974-3-phil@nwl.cc> (raw)
In-Reply-To: <20170725145629.20974-1-phil@nwl.cc>

The optional attributes 'flags', 'gc-interval' and 'timeout' have to be
delimited by stmt_separator (either newline or semicolon), not 'nl'
which is set to whitespace by set_print_plain().

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/rule.c                             | 6 +++---
 tests/monitor/testcases/set-maps.t     | 2 +-
 tests/monitor/testcases/set-mixed.t    | 2 +-
 tests/monitor/testcases/set-multiple.t | 4 ++--
 tests/monitor/testcases/set-simple.t   | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/rule.c b/src/rule.c
index 7f83980c60818..5ea4fce546e30 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -335,18 +335,18 @@ static void set_print_declaration(const struct set *set,
 			printf("%stimeout", delim);
 			delim = ",";
 		}
-		printf("%s", opts->nl);
+		printf("%s", opts->stmt_separator);
 	}
 
 	if (set->timeout) {
 		printf("%s%stimeout ", opts->tab, opts->tab);
 		time_print(set->timeout / 1000);
-		printf("%s", opts->nl);
+		printf("%s", opts->stmt_separator);
 	}
 	if (set->gc_int) {
 		printf("%s%sgc-interval ", opts->tab, opts->tab);
 		time_print(set->gc_int / 1000);
-		printf("%s", opts->nl);
+		printf("%s", opts->stmt_separator);
 	}
 }
 
diff --git a/tests/monitor/testcases/set-maps.t b/tests/monitor/testcases/set-maps.t
index d94016beb0767..6ea36cb9d11d6 100644
--- a/tests/monitor/testcases/set-maps.t
+++ b/tests/monitor/testcases/set-maps.t
@@ -2,7 +2,7 @@
 I add table ip t
 O add table ip t
 I add map ip t portip { type inet_service: ipv4_addr; flags interval; }
-O add map ip t portip { type inet_service : ipv4_addr;flags interval }
+O add map ip t portip { type inet_service : ipv4_addr;flags interval; }
 
 I add element ip t portip { 80-100: 10.0.0.1 }
 O add element ip t portip { 80-100 : 10.0.0.1 }
diff --git a/tests/monitor/testcases/set-mixed.t b/tests/monitor/testcases/set-mixed.t
index c4699edacec11..2eb35b5aa1efb 100644
--- a/tests/monitor/testcases/set-mixed.t
+++ b/tests/monitor/testcases/set-mixed.t
@@ -2,7 +2,7 @@
 I add table ip t
 O add table ip t
 I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
 I add set ip t ports { type inet_service; }
 O add set ip t ports { type inet_service;}
 
diff --git a/tests/monitor/testcases/set-multiple.t b/tests/monitor/testcases/set-multiple.t
index d94f941b39693..ce919125a593f 100644
--- a/tests/monitor/testcases/set-multiple.t
+++ b/tests/monitor/testcases/set-multiple.t
@@ -2,9 +2,9 @@
 I add table ip t
 O add table ip t
 I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
 I add set ip t portrange2 { type inet_service; flags interval; }
-O add set ip t portrange2 { type inet_service;flags interval }
+O add set ip t portrange2 { type inet_service;flags interval; }
 
 # make sure concurrent adds work
 I add element ip t portrange { 1024-65535 }
diff --git a/tests/monitor/testcases/set-simple.t b/tests/monitor/testcases/set-simple.t
index 22f648dbfa232..e44cce08f575c 100644
--- a/tests/monitor/testcases/set-simple.t
+++ b/tests/monitor/testcases/set-simple.t
@@ -2,7 +2,7 @@
 I add table ip t
 O add table ip t
 I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
 
 # adding some ranges
 I add element ip t portrange { 1-10 }
-- 
2.13.1


  parent reply	other threads:[~2017-07-25 14:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 14:56 [nft PATCH 0/6] monitor: Some fixes and improvements Phil Sutter
2017-07-25 14:56 ` [nft PATCH 1/6] tests/monitor: Ignore newgen messages in output Phil Sutter
2017-07-25 15:57   ` Pablo Neira Ayuso
2017-07-25 14:56 ` Phil Sutter [this message]
2017-07-25 15:57   ` [nft PATCH 2/6] monitor: Fix printing of set declarations Pablo Neira Ayuso
2017-07-25 17:09     ` Phil Sutter
2017-07-26 11:18       ` Pablo Neira Ayuso
2017-07-26 13:19         ` Phil Sutter
2017-07-25 14:56 ` [nft PATCH 3/6] tests/monitor: Simplify testcases Phil Sutter
2017-07-25 16:02   ` Pablo Neira Ayuso
2017-07-25 16:12     ` Pablo Neira Ayuso
2017-07-25 14:56 ` [nft PATCH 4/6] monitor: Print space after semicolon Phil Sutter
2017-07-25 16:03   ` Pablo Neira Ayuso
2017-07-25 14:56 ` [nft PATCH 5/6] tests/monitor: Clear ruleset after testing Phil Sutter
2017-07-25 16:03   ` Pablo Neira Ayuso
2017-07-25 14:56 ` [nft PATCH 6/6] tests/monitor: Add a small README Phil Sutter
2017-07-25 16:18   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170725145629.20974-3-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).