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
d8202401
Commit
d8202401
authored
Mar 17, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openvpn: take client IP for topology subnet in CSC
parent
0079214d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
openvpn.inc
src/etc/inc/plugins.inc.d/openvpn.inc
+5
-6
No files found.
src/etc/inc/plugins.inc.d/openvpn.inc
View file @
d8202401
...
...
@@ -1015,14 +1015,13 @@ function openvpn_resync_csc_conf($settings, $server)
if
(
!
empty
(
$settings
[
'tunnel_network'
]))
{
list
(
$ip
,
$mask
)
=
explode
(
'/'
,
$settings
[
'tunnel_network'
]);
if
(
$server
[
'dev_mode'
]
==
'tun'
&&
empty
(
$server
[
'topology_subnet'
]))
{
$baselong
=
ip2long32
(
$ip
)
&
gen_subnet_mask_long
(
$mask
);
$serverip
=
long2ip32
(
$baselong
+
1
);
$clientip
=
long2ip32
(
$baselong
+
2
);
/* Because this is being pushed, the order from the client's point of view. */
if
(
$server
[
'dev_mode'
]
!=
'tap'
&&
empty
(
$server
[
'topology_subnet'
]))
{
$conf
.=
"ifconfig-push
{
$clientip
}
{
$serverip
}
\n
"
;
}
else
{
$conf
.=
"ifconfig-push
{
$
client
ip
}
"
.
gen_subnet_mask
(
$mask
)
.
"
\n
"
;
$conf
.=
"ifconfig-push
{
$ip
}
"
.
gen_subnet_mask
(
$mask
)
.
"
\n
"
;
}
}
if
(
!
empty
(
$settings
[
'tunnel_networkv6'
]))
{
...
...
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