From 298fe5ae746d5240a34f66695fd6d70947765929 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 10 Nov 2011 12:01:58 -0500 Subject: Fix order of client/server IPs and add a note, and clarify variable names. Fixes #2004. --- etc/inc/openvpn.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'etc/inc/openvpn.inc') diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 8fa358f..f94967c 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -726,9 +726,10 @@ function openvpn_resync_csc(& $settings) { if (!empty($settings['tunnel_network'])) { list($ip, $mask) = explode('/', $settings['tunnel_network']); $baselong = ip2long32($ip) & gen_subnet_mask_long($mask); - $ip1 = long2ip32($baselong + 1); - $ip2 = long2ip32($baselong + 2); - $conf .= "ifconfig-push {$ip1} {$ip2}\n"; + $serverip = long2ip32($baselong + 1); + $clientip = long2ip32($baselong + 2); + /* Because this is being pushed, the order from the client's point of view. */ + $conf .= "ifconfig-push {$clientip} {$serverip}\n"; } openvpn_add_dhcpopts($settings, $conf); -- cgit v1.1