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
6d4ff188
Commit
6d4ff188
authored
Jun 26, 2012
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for empty zones
(set either addr or iface attribute to an empty list)
parent
498a67cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
awall/model.lua
awall/model.lua
+11
-9
awall/modules/filter.lua
awall/modules/filter.lua
+1
-1
awall/optfrag.lua
awall/optfrag.lua
+1
-1
No files found.
awall/model.lua
View file @
6d4ff188
...
...
@@ -41,16 +41,18 @@ function Zone:optfrags(dir)
iopt
,
aopt
,
iprop
,
aprop
=
'o'
,
'd'
,
'out'
,
'dest'
else
assert
(
false
)
end
local
aopts
=
{}
for
i
,
hostdef
in
util
.
listpairs
(
self
.
addr
)
do
for
i
,
addr
in
ipairs
(
awall
.
host
.
resolve
(
hostdef
))
do
table.insert
(
aopts
,
{
family
=
addr
[
1
],
[
aprop
]
=
addr
[
2
],
opts
=
'-'
..
aopt
..
' '
..
addr
[
2
]})
local
aopts
=
nil
if
self
.
addr
then
aopts
=
{}
for
i
,
hostdef
in
util
.
listpairs
(
self
.
addr
)
do
for
i
,
addr
in
ipairs
(
awall
.
host
.
resolve
(
hostdef
))
do
table.insert
(
aopts
,
{
family
=
addr
[
1
],
[
aprop
]
=
addr
[
2
],
opts
=
'-'
..
aopt
..
' '
..
addr
[
2
]})
end
end
end
if
not
aopts
[
1
]
then
aopts
=
nil
end
return
combinations
(
util
.
maplist
(
self
.
iface
,
function
(
x
)
...
...
@@ -324,7 +326,7 @@ function Rule:trules()
target
=
self
:
newchain
(
'address'
)
else
target
=
self
:
target
()
if
addrofrags
then
res
=
combinations
(
res
,
addrofrags
)
end
res
=
combinations
(
res
,
addrofrags
)
end
tag
(
res
,
'position'
,
self
:
position
())
...
...
awall/modules/filter.lua
View file @
6d4ff188
...
...
@@ -25,7 +25,7 @@ function Filter:destoptfrags()
local
ofrags
=
model
.
Rule
.
destoptfrags
(
self
)
if
not
self
.
dnat
then
return
ofrags
end
ofrags
=
awall
.
optfrag
.
combinations
(
ofrags
,
{{
family
=
'inet6'
}})
or
{}
ofrags
=
awall
.
optfrag
.
combinations
(
ofrags
,
{{
family
=
'inet6'
}})
local
natof
=
model
.
Zone
.
morph
({
addr
=
self
.
dnat
}):
optfrags
(
'out'
)
assert
(
#
natof
==
1
)
table.insert
(
ofrags
,
natof
[
1
])
...
...
awall/optfrag.lua
View file @
6d4ff188
...
...
@@ -44,5 +44,5 @@ function combinations(of1, of2)
end
end
return
res
[
1
]
and
res
or
nil
return
res
end
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