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
b4ef16cb
Commit
b4ef16cb
authored
Nov 27, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: this one has an external call-site :(
parent
a3474575
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
filter.inc
src/etc/inc/filter.inc
+3
-3
firewall_nat_out.php
src/www/firewall_nat_out.php
+4
-2
system_general.php
src/www/system_general.php
+1
-0
No files found.
src/etc/inc/filter.inc
View file @
b4ef16cb
...
@@ -1363,9 +1363,9 @@ function filter_generate_reflection_proxy($rule, $nordr, $rdr_ifs, $srcaddr, $ds
...
@@ -1363,9 +1363,9 @@ function filter_generate_reflection_proxy($rule, $nordr, $rdr_ifs, $srcaddr, $ds
return
$natrules
;
return
$natrules
;
}
}
function
filter_nat_rules_automatic_tonathosts
(
$with_descr
=
false
)
{
function
filter_nat_rules_automatic_tonathosts
(
&
$filterIflist
,
$with_descr
=
false
)
{
global
$config
,
$GatewaysList
;
global
$config
,
$GatewaysList
;
$FilterIflist
=
filter_generate_optcfg_array
()
;
$tonathosts
=
array
(
"127.0.0.0/8"
);
$tonathosts
=
array
(
"127.0.0.0/8"
);
$descriptions
=
array
(
gettext
(
"localhost"
));
$descriptions
=
array
(
gettext
(
"localhost"
));
...
@@ -1835,7 +1835,7 @@ function filter_nat_rules_generate(&$FilterIflist)
...
@@ -1835,7 +1835,7 @@ function filter_nat_rules_generate(&$FilterIflist)
$natrules
.=
"
\n
# Outbound NAT rules (automatic)
\n
"
;
$natrules
.=
"
\n
# Outbound NAT rules (automatic)
\n
"
;
/* standard outbound rules (one for each interface) */
/* standard outbound rules (one for each interface) */
update_filter_reload_status
(
gettext
(
"Creating outbound NAT rules"
));
update_filter_reload_status
(
gettext
(
"Creating outbound NAT rules"
));
$tonathosts_array
=
filter_nat_rules_automatic_tonathosts
();
$tonathosts_array
=
filter_nat_rules_automatic_tonathosts
(
$FilterIflist
);
$tonathosts
=
implode
(
" "
,
$tonathosts_array
);
$tonathosts
=
implode
(
" "
,
$tonathosts_array
);
$numberofnathosts
=
count
(
$tonathosts_array
);
$numberofnathosts
=
count
(
$tonathosts_array
);
...
...
src/www/firewall_nat_out.php
View file @
b4ef16cb
...
@@ -74,7 +74,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
...
@@ -74,7 +74,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if
(
empty
(
$GatewaysList
))
{
if
(
empty
(
$GatewaysList
))
{
filter_generate_gateways
();
filter_generate_gateways
();
}
}
$tonathosts
=
filter_nat_rules_automatic_tonathosts
(
true
);
/* XXX cranky low-level call, please refactor */
$tonathosts
=
filter_nat_rules_automatic_tonathosts
(
filter_generate_optcfg_array
(),
true
);
$automatic_rules
=
filter_nat_rules_outbound_automatic
(
""
);
$automatic_rules
=
filter_nat_rules_outbound_automatic
(
""
);
foreach
(
$tonathosts
as
$tonathost
)
{
foreach
(
$tonathosts
as
$tonathost
)
{
...
@@ -479,7 +480,8 @@ include("head.inc");
...
@@ -479,7 +480,8 @@ include("head.inc");
if
(
$mode
==
"automatic"
||
$mode
==
"hybrid"
)
:
if
(
$mode
==
"automatic"
||
$mode
==
"hybrid"
)
:
if
(
empty
(
$GatewaysList
))
if
(
empty
(
$GatewaysList
))
filter_generate_gateways
();
filter_generate_gateways
();
$automatic_rules
=
filter_nat_rules_outbound_automatic
(
implode
(
" "
,
filter_nat_rules_automatic_tonathosts
()));
/* XXX cranky low-level call, please refactor */
$automatic_rules
=
filter_nat_rules_outbound_automatic
(
implode
(
" "
,
filter_nat_rules_automatic_tonathosts
(
filter_generate_optcfg_array
())));
unset
(
$GatewaysList
);
unset
(
$GatewaysList
);
?>
?>
<section
class=
"col-xs-12"
>
<section
class=
"col-xs-12"
>
...
...
src/www/system_general.php
View file @
b4ef16cb
...
@@ -171,6 +171,7 @@ if ($_POST) {
...
@@ -171,6 +171,7 @@ if ($_POST) {
}
}
}
}
}
}
/* XXX cranky low-level call, please refactor */
$direct_networks_list
=
explode
(
' '
,
filter_get_direct_networks_list
(
filter_generate_optcfg_array
()));
$direct_networks_list
=
explode
(
' '
,
filter_get_direct_networks_list
(
filter_generate_optcfg_array
()));
for
(
$dnscounter
=
1
;
$dnscounter
<
5
;
$dnscounter
++
)
{
for
(
$dnscounter
=
1
;
$dnscounter
<
5
;
$dnscounter
++
)
{
$dnsitem
=
"dns
{
$dnscounter
}
"
;
$dnsitem
=
"dns
{
$dnscounter
}
"
;
...
...
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