]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: print space between policy and timeout
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Jul 2019 17:56:08 +0000 (19:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Jul 2019 18:43:02 +0000 (20:43 +0200)
 table ip filter {
        ct timeout agressive-tcp {
...
                policy = { established : 100, close_wait : 4, close : 4 }
                                      ^ ^               ^ ^        ^ ^

for consistency with map syntax.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c
tests/shell/testcases/listing/0013objects_0
tests/shell/testcases/nft-f/0017ct_timeout_obj_0
tests/shell/testcases/nft-f/dumps/0017ct_timeout_obj_0.nft

index 6dbc553e6c3384d410598e7472b835fe9b86ff6b..0a91917f7568d4f0b018f522ea2be21f54d1a99f 100644 (file)
@@ -1760,7 +1760,7 @@ static void print_proto_timeout_policy(uint8_t l4, const uint32_t *timeout,
                if (timeout[i] != timeout_protocol[l4].dflt_timeout[i]) {
                        if (comma)
                                nft_print(octx, ", ");
-                       nft_print(octx, "%s: %u",
+                       nft_print(octx, "%s : %u",
                                  timeout_protocol[l4].state_to_name[i],
                                  timeout[i]);
                        comma = true;
index a73642c72635f3c6a1b00afafd4a41473c20bcc4..da782a68b8e46b3ce683a4e6a64eb5ec63db7d14 100755 (executable)
@@ -15,7 +15,7 @@ EXPECTED="table ip test {
        ct timeout cttime {
                protocol udp
                l3proto ip
-               policy = { unreplied: 15, replied: 12 }
+               policy = { unreplied : 15, replied : 12 }
        }
 
        chain input {
@@ -28,7 +28,7 @@ $NFT add table test
 $NFT add chain test input
 $NFT add quota test https-quota 25 mbytes
 $NFT add ct helper test cthelp { type \"sip\" protocol tcp \; }
-$NFT add ct timeout test cttime { protocol udp \; policy = {replied: 12, unreplied: 15 } \; }
+$NFT add ct timeout test cttime { protocol udp \; policy = {replied : 12, unreplied : 15 } \; }
 $NFT add table test-ip
 
 GET="$($NFT list table test)"
index 3e0a768487c7201fa17ef88f71060e8dbb5692b7..1d6a0f7c84cfde1d702c45aa4bb0655c77c421a1 100755 (executable)
@@ -4,7 +4,7 @@ EXPECTED='table ip filter {
        ct timeout cttime{
                protocol tcp
                l3proto ip
-               policy = { established: 123, close: 12 }
+               policy = { established : 123, close : 12 }
        }
 
        chain c {
index 1638b97d8c6b943e5700a08d6991818a5fd833df..7cff1ed5f21c725f3900ad4c120d371a31b84ec3 100644 (file)
@@ -2,7 +2,7 @@ table ip filter {
        ct timeout cttime {
                protocol tcp
                l3proto ip
-               policy = { established: 123, close: 12 }
+               policy = { established : 123, close : 12 }
        }
 
        chain c {