From 5e20654577393326d9a7b87fff9f76ba3677a32b Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 31 Oct 2013 15:04:35 -0400 Subject: Allow the client export package to properly match the compression setting on 2.2 --- config/openvpn-client-export/openvpn-client-export.inc | 10 ++++++++-- config/openvpn-client-export/openvpn-client-export.xml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'config/openvpn-client-export') diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index 12842d64..c7afb9e6 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -172,6 +172,7 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) { function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $quoteservercn, $usetoken, $nokeys = false, $proxy, $expformat = "baseconf", $outpass = "", $skiptls=false, $doslines=false, $openvpnmanager, $advancedoptions = "") { global $config, $input_errors, $g; + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); $nl = ($doslines) ? "\r\n" : "\n"; $conf = ""; @@ -297,8 +298,13 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $quotese } // add optional settings - if ($settings['compression']) - $conf .= "comp-lzo{$nl}"; + if (!empty($settings['compression'])) { + if ($pfs_version > 2.1) + $conf .= "comp-lzo {$settings['compression']}{$nl}"; + else + $conf .= "comp-lzo{$nl}"; + } + if ($settings['passtos']) $conf .= "passtos{$nl}"; diff --git a/config/openvpn-client-export/openvpn-client-export.xml b/config/openvpn-client-export/openvpn-client-export.xml index 37490d12..a1c263f1 100755 --- a/config/openvpn-client-export/openvpn-client-export.xml +++ b/config/openvpn-client-export/openvpn-client-export.xml @@ -1,7 +1,7 @@ OpenVPN Client Export - 1.1.2 + 1.1.3 OpenVPN Client Export /usr/local/pkg/openvpn-client-export.inc -- cgit v1.2.3