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
cacfdd05
Commit
cacfdd05
authored
Oct 25, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(filter) work in progress filter refactoring
parent
f88eabc0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
FilterRule.php
...opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php
+12
-7
No files found.
src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php
View file @
cacfdd05
...
@@ -107,16 +107,21 @@ class FilterRule
...
@@ -107,16 +107,21 @@ class FilterRule
$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'
)
{
if
(
isset
(
$this
->
rule
[
'ipprotocol'
])
&&
$this
->
rule
[
'ipprotocol'
]
==
'inet46'
)
{
foreach
(
array
(
'inet'
,
'inet6'
)
as
$ipproto
)
{
$ipprotos
=
array
(
'inet'
,
'inet6'
);
}
elseif
(
isset
(
$this
->
rule
[
'ipprotocol'
]))
{
$ipprotos
=
array
(
$this
->
rule
[
'ipprotocol'
]);
}
else
{
$ipprotos
=
array
(
null
);
}
foreach
(
$ipprotos
as
$ipproto
)
{
$tmp
=
$this
->
rule
;
$tmp
=
$this
->
rule
;
$tmp
[
'interface'
]
=
$interface
;
$tmp
[
'interface'
]
=
$interface
;
$tmp
[
'ipprotocol'
]
=
$ipproto
;
$tmp
[
'ipprotocol'
]
=
$ipproto
;
$result
[]
=
$tmp
;
if
(
empty
(
$this
->
interfaceMapping
[
$interface
][
'if'
]))
{
// disable rule when interface not found
$tmp
[
'disabled'
]
=
true
;
}
}
}
else
{
$result
[]
=
$tmp
;
$tmp
=
$this
->
rule
;
$tmp
[
'interface'
]
=
$interface
;
$result
[]
=
$this
->
rule
;
}
}
}
}
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