Commit d8202401 authored by Franco Fichtner's avatar Franco Fichtner

openvpn: take client IP for topology subnet in CSC

parent 0079214d
......@@ -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 {$clientip} " . gen_subnet_mask($mask) . "\n";
$conf .= "ifconfig-push {$ip} " . gen_subnet_mask($mask) . "\n";
}
}
if (!empty($settings['tunnel_networkv6'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment