aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/openvpn-client-export.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-10-31 15:04:35 -0400
committerjim-p <jimp@pfsense.org>2013-10-31 15:04:35 -0400
commit5e20654577393326d9a7b87fff9f76ba3677a32b (patch)
tree6dd169e3c410d6ef62e4eb7822a9abb2266ba467 /config/openvpn-client-export/openvpn-client-export.inc
parentd7423bc9ccd2e9084cbc35d5a577fdc7c9afa6be (diff)
downloadpfsense-packages-5e20654577393326d9a7b87fff9f76ba3677a32b.tar.gz
pfsense-packages-5e20654577393326d9a7b87fff9f76ba3677a32b.tar.bz2
pfsense-packages-5e20654577393326d9a7b87fff9f76ba3677a32b.zip
Allow the client export package to properly match the compression setting on 2.2
Diffstat (limited to 'config/openvpn-client-export/openvpn-client-export.inc')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc10
1 files changed, 8 insertions, 2 deletions
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}";