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
e2b1f644
Commit
e2b1f644
authored
Nov 27, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openvpn: ok to call filter_generate_optcfg_array here
parent
3df63a5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
openvpn-client-export.inc
src/etc/inc/openvpn-client-export.inc
+10
-5
No files found.
src/etc/inc/openvpn-client-export.inc
View file @
e2b1f644
...
...
@@ -839,13 +839,16 @@ function openvpn_client_export_build_remote_lines($settings, $useaddr, $interfac
return
implode
(
$nl
,
$remotes
);
}
function
openvpn_client_export_find_port_forwards
(
$targetip
,
$targetport
,
$targetproto
,
$skipprivate
,
$findhostname
=
false
)
{
function
openvpn_client_export_find_port_forwards
(
$targetip
,
$targetport
,
$targetproto
,
$skipprivate
,
$findhostname
=
false
)
{
global
$config
;
$FilterIflist
=
filter_generate_optcfg_array
()
;
$FilterIflist
=
filter_generate_optcfg_array
();
$destinations
=
array
();
if
(
!
is
_array
(
$config
[
'nat'
])
||
!
is_array
(
$config
[
'nat'
][
'rule'
]))
if
(
!
is
set
(
$config
[
'nat'
][
'rule'
]))
{
return
$destinations
;
}
foreach
(
$config
[
'nat'
][
'rule'
]
as
$natent
)
{
$dest
=
array
();
...
...
@@ -862,12 +865,14 @@ function openvpn_client_export_find_port_forwards($targetip, $targetport, $targe
// Could be network or address ...
$natif
=
(
!
$natent
[
'interface'
])
?
"wan"
:
$natent
[
'interface'
];
if
(
!
isset
(
$FilterIflist
[
$natif
]))
if
(
!
isset
(
$FilterIflist
[
$natif
]))
{
continue
;
// Skip if there is no interface
}
$dstaddr
=
trim
(
filter_generate_address
(
$natent
,
'destination'
,
true
));
if
(
!
$dstaddr
)
if
(
!
$dstaddr
)
{
$dstaddr
=
$FilterIflist
[
$natif
][
'ip'
];
}
$dstaddr_port
=
explode
(
" "
,
$dstaddr
);
...
...
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