]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
meters: do not set a defaut meter size from userspace
authorFlorian Westphal <fw@strlen.de>
Tue, 29 May 2018 11:47:11 +0000 (13:47 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 29 May 2018 11:48:19 +0000 (13:48 +0200)
doing this breaks with older kernels as it will pick a set without
and update callback.

Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_bison.y
tests/py/ip/flowtable.t
tests/py/ip/flowtable.t.json
tests/py/ip/flowtable.t.payload
tests/py/ip6/flowtable.t
tests/py/ip6/flowtable.t.json
tests/py/ip6/flowtable.t.payload

index 0e3ee84f3c400cbe80a966c947bae27c1d452fe3..1eb6ec6e93f254eecd2ec8f5ee9cb2df344a5ac3 100644 (file)
@@ -2789,7 +2789,7 @@ meter_stmt_alloc  :       METER   identifier              '{' meter_key_expr stmt '}'
                        {
                                $$ = meter_stmt_alloc(&@$);
                                $$->meter.name = $2;
-                               $$->meter.size = 0xffff;
+                               $$->meter.size = 0;
                                $$->meter.key  = $4;
                                $$->meter.stmt = $5;
                                $$->location  = @$;
index 7a68788a7df148eb99b1b112fc1b462e143d79de..086c6cf6b4497fa1a7739b59acc0af0931a561d9 100644 (file)
@@ -2,4 +2,4 @@
 
 *ip;test-ip;input
 
-meter xyz { ip saddr timeout 30s counter};ok;meter xyz size 65535 { ip saddr timeout 30s counter}
+meter xyz size 8192 { ip saddr timeout 30s counter};ok
index e6fc09f4a3348195c7854202b93ca912d40b1fe8..ca4b5f61972e455468d61cfd8e0436aba1ae8f2b 100644 (file)
@@ -1,4 +1,4 @@
-# meter xyz { ip saddr timeout 30s counter}
+# meter xyz size 8192 { ip saddr timeout 30s counter}
 [
     {
         "meter": {
index 34a584994b64bf1d7b06e3189f2f41f2a99e2ce4..c0aad39ea193abd627fd9d91af61b411cae694d8 100644 (file)
@@ -1,4 +1,4 @@
-# meter xyz { ip saddr timeout 30s counter}
+# meter xyz size 8192 { ip saddr timeout 30s counter}
 xyz test-ip 31
 xyz test-ip 0
 ip test-ip input 
index d89e90c3edc4653900645ac6722708ed82c59f2a..e58d51bb9b8e227b1b78b6958151356462a68289 100644 (file)
@@ -2,5 +2,5 @@
 
 *ip6;test-ip6;input
 
-meter acct_out { meta iif . ip6 saddr timeout 600s counter };ok;meter acct_out size 65535 { iif . ip6 saddr timeout 10m counter}
-meter acct_out { ip6 saddr . meta iif timeout 600s counter };ok;meter acct_out size 65535 { ip6 saddr . iif timeout 10m counter}
+meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter };ok;meter acct_out size 4096 { iif . ip6 saddr timeout 10m counter }
+meter acct_out size 12345 { ip6 saddr . meta iif timeout 600s counter };ok;meter acct_out size 12345 { ip6 saddr . iif timeout 10m counter }
index f707ae9ad607f04358e70c59ba8eb42d9fd32272..e3d05339b5554b33e7002a8334ddd71b1278d57f 100644 (file)
@@ -1,4 +1,4 @@
-# meter acct_out { meta iif . ip6 saddr timeout 600s counter }
+# meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter }
 [
     {
         "meter": {
@@ -28,7 +28,7 @@
     }
 ]
 
-# meter acct_out { ip6 saddr . meta iif timeout 600s counter }
+# meter acct_out size 12345 { ip6 saddr . meta iif timeout 600s counter }
 [
     {
         "meter": {
index a3f71b1304dc16f699c92871e2f59a1bd8c95bc9..559475f6d2c6f037e700f3850efa6b177d719f39 100644 (file)
@@ -1,4 +1,4 @@
-# meter acct_out { meta iif . ip6 saddr timeout 600s counter }
+# meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter }
 acct_out test-ip6 31
 acct_out test-ip6 0
 ip6 test-ip6 input
@@ -6,7 +6,7 @@ ip6 test-ip6 input
   [ payload load 16b @ network header + 8 => reg 9 ]
   [ dynset update reg_key 1 set acct_out timeout 600000ms expr [ counter pkts 0 bytes 0 ] ]
 
-# meter acct_out { ip6 saddr . meta iif timeout 600s counter }
+# meter acct_out size 12345 { ip6 saddr . meta iif timeout 600s counter }
 acct_out test-ip6 31
 acct_out test-ip6 0
 ip6 test-ip6 input