Commit f11784f3 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

Filter: fix regression with flow-limit and no-track

fixes #7456
parent a9ea2607
......@@ -394,9 +394,9 @@ function Filter:mangleoptfrags(ofrags)
local limitobj = self:create(FilterLimit, self[limit], 'limit')
local ofs
local conn = limit == 'conn-limit'
local final = self:position() == 'append'
local target = self:target()
local ct = conn and target
local ft = final and target
local pl = not target and self.log
local cofs, sofs = limitobj:recentofrags(limitchain)
......@@ -405,7 +405,7 @@ function Filter:mangleoptfrags(ofrags)
ofs = self:combinelog(cofs, limitlog, 'drop', 'DROP')
local nxt
if ct then
if ft then
extend(ofs, self:actofrags(self.log))
nxt = target
elseif sofs and not (pl and pl:target()) then nxt = false end
......@@ -415,7 +415,7 @@ function Filter:mangleoptfrags(ofrags)
if pl then incompatible('action or log') end
local limofs = limitobj:limitofrags(limitchain)
ofs = ct and Filter.super(self):mangleoptfrags(limofs) or
ofs = ft and Filter.super(self):mangleoptfrags(limofs) or
combinations(limofs, {{target='RETURN'}})
extend(ofs, self:actofrags(limitlog, 'DROP'))
......
......@@ -94,6 +94,208 @@
{ "flow-limit": { "count": 30, "log": "none" } },
{ "flow-limit": { "count": 30, "log": "none" }, "action": "pass" },
{ "flow-limit": { "count": 30, "log": "none" }, "log": true },
{ "flow-limit": { "count": 30, "log": "none" }, "log": "none" }
{ "flow-limit": { "count": 30, "log": "none" }, "log": "none" },
{ "in": "A", "out": "_fw", "flow-limit": 1, "no-track": true },
{
"in": "A",
"out": "_fw",
"flow-limit": 1,
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 1,
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 1,
"log": true,
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 1,
"log": "none",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 1,
"log": "none",
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"log": true,
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"log": "none",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": false },
"log": "none",
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"log": true,
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"log": "none",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 1, "log": "none" },
"log": "none",
"action": "pass",
"no-track": true
},
{ "in": "A", "out": "_fw", "flow-limit": 30, "no-track": true },
{
"in": "A",
"out": "_fw",
"flow-limit": 30,
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 30,
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": 30,
"log": "none",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": false },
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": false },
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": false },
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": false },
"log": "none",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": "none" },
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": "none" },
"action": "pass",
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": "none" },
"log": true,
"no-track": true
},
{
"in": "A",
"out": "_fw",
"flow-limit": { "count": 30, "log": "none" },
"log": "none",
"no-track": true
}
]
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment