Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
awall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
awall
Commits
f11784f3
Commit
f11784f3
authored
Jun 29, 2017
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter: fix regression with flow-limit and no-track
fixes #7456
parent
a9ea2607
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1628 additions
and
94 deletions
+1628
-94
awall/modules/filter.lua
awall/modules/filter.lua
+4
-4
test/mandatory/filter-limit.json
test/mandatory/filter-limit.json
+203
-1
test/output/dump
test/output/dump
+963
-71
test/output/rules-save
test/output/rules-save
+229
-9
test/output/rules6-save
test/output/rules6-save
+229
-9
No files found.
awall/modules/filter.lua
View file @
f11784f3
...
...
@@ -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
c
t
then
if
f
t
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
=
c
t
and
Filter
.
super
(
self
):
mangleoptfrags
(
limofs
)
or
ofs
=
f
t
and
Filter
.
super
(
self
):
mangleoptfrags
(
limofs
)
or
combinations
(
limofs
,
{{
target
=
'RETURN'
}})
extend
(
ofs
,
self
:
actofrags
(
limitlog
,
'DROP'
))
...
...
test/mandatory/filter-limit.json
View file @
f11784f3
...
...
@@ -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
}
]
}
test/output/dump
View file @
f11784f3
This diff is collapsed.
Click to expand it.
test/output/rules-save
View file @
f11784f3
This diff is collapsed.
Click to expand it.
test/output/rules6-save
View file @
f11784f3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment