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
dcd475dc
Commit
dcd475dc
authored
Oct 23, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) openvpn redundant code
parent
a1c151e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
openvpn.inc
src/etc/inc/openvpn.inc
+7
-18
No files found.
src/etc/inc/openvpn.inc
View file @
dcd475dc
...
@@ -394,26 +394,18 @@ function openvpn_reconfigure($mode, $settings)
...
@@ -394,26 +394,18 @@ function openvpn_reconfigure($mode, $settings)
$interface
=
get_failover_interface
(
$settings
[
'interface'
]);
$interface
=
get_failover_interface
(
$settings
[
'interface'
]);
$ipaddr
=
$settings
[
'ipaddr'
];
$ipaddr
=
$settings
[
'ipaddr'
];
$ipaddrv6
=
$settings
[
'ipaddrv6'
];
// If a specific ip address (VIP) is requested, use it.
// If a specific ip address (VIP) is requested, use it.
// Otherwise, if a specific interface is requested, use it
// Otherwise, if a specific interface is requested, use it
// If "any" interface was selected, local directive will be ommited.
// If "any" interface was selected, local directive will be ommited.
if
(
is_ipaddr
v4
(
$ipaddr
))
{
if
(
is_ipaddr
(
$ipaddr
))
{
$iface_ip
=
$ipaddr
;
$iface_ip
=
$ipaddr
;
}
else
{
}
elseif
(
!
empty
(
$interface
)
&&
$interface
!=
"any"
)
{
if
((
!
empty
(
$interface
))
&&
(
strcmp
(
$interface
,
"any"
)))
{
$iface_ip
=
get_interface_ip
(
$interface
);
$iface_ip
=
get_interface_ip
(
$interface
);
if
(
empty
(
$iface_ip
))
{
}
$iface_ip
=
get_interface_ipv6
(
$interface
);
}
if
(
is_ipaddrv6
(
$ipaddrv6
))
{
$iface_ipv6
=
$ipaddrv6
;
}
else
{
if
((
!
empty
(
$interface
))
&&
(
strcmp
(
$interface
,
"any"
)))
{
$iface_ipv6
=
get_interface_ipv6
(
$interface
);
}
}
}
}
$conf
=
"dev
{
$devname
}
\n
"
;
$conf
=
"dev
{
$devname
}
\n
"
;
if
(
isset
(
$settings
[
'verbosity_level'
]))
{
if
(
isset
(
$settings
[
'verbosity_level'
]))
{
...
@@ -453,11 +445,8 @@ function openvpn_reconfigure($mode, $settings)
...
@@ -453,11 +445,8 @@ function openvpn_reconfigure($mode, $settings)
}
}
}
}
/* Determine the local IP to use - and make sure it matches with the selected protocol. */
if
(
!
empty
(
$iface_ip
))
{
if
(
is_ipaddrv4
(
$iface_ip
)
&&
(
stristr
(
$settings
[
'protocol'
],
"6"
)
===
false
))
{
$conf
.=
"local
{
$iface_ip
}
\n
"
;
$conf
.=
"local
{
$iface_ip
}
\n
"
;
}
elseif
(
is_ipaddrv6
(
$iface_ipv6
)
&&
(
stristr
(
$settings
[
'protocol'
],
"6"
)
!==
false
))
{
$conf
.=
"local
{
$iface_ipv6
}
\n
"
;
}
}
if
(
openvpn_validate_engine
(
$settings
[
'engine'
])
&&
(
$settings
[
'engine'
]
!=
"none"
))
if
(
openvpn_validate_engine
(
$settings
[
'engine'
])
&&
(
$settings
[
'engine'
]
!=
"none"
))
...
...
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