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
6a0ca2d8
Commit
6a0ca2d8
authored
Nov 27, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: conversion is done
(cherry picked from commit
afad392e
)
parent
7656c365
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
filter.inc
src/etc/inc/filter.inc
+9
-5
No files found.
src/etc/inc/filter.inc
View file @
6a0ca2d8
...
...
@@ -1059,12 +1059,12 @@ function filter_get_reflection_interfaces(&$FilterIflist, $natif = '')
foreach
(
$FilterIflist
as
$ifent
=>
$ifname
)
{
if
(
$ifname
[
'if'
]
==
$natif
)
{
continue
;
}
}
/* Do not add reflection redirects for interfaces with gateways */
if
(
interface_has_gateway
(
$ifent
))
{
continue
;
}
}
$nat_if_list
[]
=
$ifname
[
'if'
];
}
...
...
@@ -1541,9 +1541,10 @@ function filter_nat_rules_outbound_automatic(&$FilterIflist, $src)
}
/* Generate a 'nat on' or 'no nat on' rule for given interface */
function
filter_nat_rules_generate_if
(
$if
,
$src
=
"any"
,
$srcport
=
""
,
$dst
=
"any"
,
$dstport
=
""
,
$natip
=
""
,
$natport
=
""
,
$nonat
=
false
,
$staticnatport
=
false
,
$proto
=
""
,
$poolopts
=
""
)
{
function
filter_nat_rules_generate_if
(
&
$FilterIflist
,
$if
,
$src
=
"any"
,
$srcport
=
""
,
$dst
=
"any"
,
$dstport
=
""
,
$natip
=
""
,
$natport
=
""
,
$nonat
=
false
,
$staticnatport
=
false
,
$proto
=
""
,
$poolopts
=
""
)
{
global
$config
;
$FilterIflist
=
filter_generate_optcfg_array
()
;
/* XXX: billm - any idea if this code is needed? */
if
(
$src
==
"/32"
||
$src
{
0
}
==
"/"
)
{
return
"# src incorrectly specified
\n
"
;
...
...
@@ -1830,7 +1831,9 @@ function filter_nat_rules_generate(&$FilterIflist)
$obtarget
=
(
$obent
[
'target'
]
==
"other-subnet"
)
?
$obent
[
'targetip'
]
.
'/'
.
$obent
[
'targetip_subnet'
]
:
$obent
[
'target'
];
$poolopts
=
(
is_subnet
(
$obtarget
)
||
is_alias
(
$obtarget
))
?
$obent
[
'poolopts'
]
:
""
;
$natrules
.=
filter_nat_rules_generate_if
(
$obent
[
'interface'
],
$natrules
.=
filter_nat_rules_generate_if
(
$FilterIflist
,
$obent
[
'interface'
],
$src
,
$obent
[
'sourceport'
],
$dst
,
...
...
@@ -1872,6 +1875,7 @@ function filter_nat_rules_generate(&$FilterIflist)
$a_outs
=
filter_nat_rules_outbound_automatic
(
$FilterIflist
,
$macroortable
);
foreach
(
$a_outs
as
$a_out
)
{
$natrules
.=
filter_nat_rules_generate_if
(
$FilterIflist
,
$a_out
[
'interface'
],
$a_out
[
'source'
][
'network'
],
isset
(
$a_out
[
'sourceport'
])
?
$a_out
[
'sourceport'
]
:
null
,
...
...
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