Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
89c55e1b
Commit
89c55e1b
authored
Oct 31, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(filter) refactor inet46 to single rule and add some more tags
parent
b9c8e159
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
44 deletions
+43
-44
FilterRule.php
...opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php
+43
-44
No files found.
src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php
View file @
89c55e1b
...
@@ -46,6 +46,9 @@ class FilterRule
...
@@ -46,6 +46,9 @@ class FilterRule
'interface'
=>
'parseInterface'
,
'interface'
=>
'parseInterface'
,
'ipprotocol'
=>
'parsePlain'
,
'ipprotocol'
=>
'parsePlain'
,
'protocol'
=>
'parseReplaceSimple,tcp/udp:{tcp udp}'
,
'protocol'
=>
'parseReplaceSimple,tcp/udp:{tcp udp}'
,
'from'
=>
'parsePlain'
,
'to'
=>
'parsePlain'
,
'icmp6-type'
=>
'parsePlain,{,}'
,
'state'
=>
'parseState'
,
'state'
=>
'parseState'
,
'label'
=>
'parsePlain,label ","'
'label'
=>
'parsePlain,label ","'
);
);
...
@@ -161,17 +164,14 @@ class FilterRule
...
@@ -161,17 +164,14 @@ class FilterRule
$result
=
array
();
$result
=
array
();
$interfaces
=
empty
(
$this
->
rule
[
'interface'
])
?
array
(
null
)
:
explode
(
','
,
$this
->
rule
[
'interface'
]);
$interfaces
=
empty
(
$this
->
rule
[
'interface'
])
?
array
(
null
)
:
explode
(
','
,
$this
->
rule
[
'interface'
]);
foreach
(
$interfaces
as
$interface
)
{
foreach
(
$interfaces
as
$interface
)
{
if
(
isset
(
$this
->
rule
[
'ipprotocol'
])
&&
$this
->
rule
[
'ipprotocol'
]
==
'inet46'
)
{
$tmp
=
$this
->
rule
;
$ipprotos
=
array
(
'inet'
,
'inet6'
);
// protocol handling
}
elseif
(
isset
(
$this
->
rule
[
'ipprotocol'
])
)
{
if
(
empty
(
$this
->
rule
[
'ipprotocol'
])
||
$this
->
rule
[
'ipprotocol'
]
==
'inet46'
)
{
$
ipprotos
=
array
(
$this
->
rule
[
'ipprotocol'
])
;
$
tmp
[
'ipprotocol'
]
=
""
;
}
else
{
}
else
{
$
ipprotos
=
array
(
null
)
;
$
tmp
[
'ipprotocol'
]
=
$this
->
rule
[
'ipprotocol'
]
;
}
}
foreach
(
$ipprotos
as
$ipproto
)
{
$tmp
=
$this
->
rule
;
$tmp
[
'interface'
]
=
$interface
;
$tmp
[
'interface'
]
=
$interface
;
$tmp
[
'ipprotocol'
]
=
$ipproto
;
// disable rule when interface not found
// disable rule when interface not found
if
(
!
empty
(
$interface
)
&&
empty
(
$this
->
interfaceMapping
[
$interface
][
'if'
]))
{
if
(
!
empty
(
$interface
)
&&
empty
(
$this
->
interfaceMapping
[
$interface
][
'if'
]))
{
$tmp
[
'disabled'
]
=
true
;
$tmp
[
'disabled'
]
=
true
;
...
@@ -212,7 +212,6 @@ class FilterRule
...
@@ -212,7 +212,6 @@ class FilterRule
}
}
$result
[]
=
$tmp
;
$result
[]
=
$tmp
;
}
}
}
return
$result
;
return
$result
;
}
}
...
...
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