diff options
author | Chris Buechler <cmb@pfsense.org> | 2015-10-26 00:23:37 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-10-26 00:23:37 -0500 |
commit | 5d6dde8af7288b2b7f4c34679ac027865d16ae0a (patch) | |
tree | 27a84b6283c953050c38b7998216edb92dc495aa | |
parent | add49a3a21e58bcc531e2f0a2ff816c7a8e825a8 (diff) | |
download | pfsense-5d6dde8af7288b2b7f4c34679ac027865d16ae0a.zip pfsense-5d6dde8af7288b2b7f4c34679ac027865d16ae0a.tar.gz |
Use 1-6 rather than 0-5 for IPsec logging levels, to stay away from complications of 0 due to PHP stupidity. Upgrade config to add 1 to any configured log levels. Default to 1 as log level where none is configured by the user. Ticket #5340
-rw-r--r-- | conf.default/config.xml | 2 | ||||
-rw-r--r-- | etc/inc/globals.inc | 2 | ||||
-rw-r--r-- | etc/inc/upgrade_config.inc | 17 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 8 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_settings.php | 10 |
5 files changed, 31 insertions, 8 deletions
diff --git a/conf.default/config.xml b/conf.default/config.xml index 8979fc3..3a7785f 100644 --- a/conf.default/config.xml +++ b/conf.default/config.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <pfsense> - <version>11.9</version> + <version>12.0</version> <lastchange/> <theme>pfsense_ng</theme> <system> diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 8ee4052..c2e5832 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -74,7 +74,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "11.9", + "latest_config" => "12.0", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 07c0df0..3b41251 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -3647,6 +3647,23 @@ function upgrade_118_to_119() { $ph1_entry['peerid_type'] = "any"; } } + +} + +function upgrade_119_to_120() { + global $config, $ipsec_loglevels; + + if (!is_array($config['ipsec'])) { + return; + } + + // add 1 to configured log levels as part of redmine #5340 + foreach ($ipsec_loglevels as $lkey => $ldescr) { + if (isset($config['ipsec']['ipsec_{$lkey}'])) { + $config['ipsec']['ipsec_{$lkey}'] = $config['ipsec']['ipsec_{$lkey}'] + 1; + } + } + } ?> diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index d3baf1b..3adf11b 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -49,11 +49,11 @@ function vpn_ipsec_configure_loglevels($forconfig = false) { $cfgtext = array(); foreach ($ipsec_loglevels as $lkey => $ldescr) { if (!isset($config['ipsec']["ipsec_{$lkey}"]) && !$forconfig) { - mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} -- -1", false); + mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} -- 1", false); } else if (is_numeric($config['ipsec']["ipsec_{$lkey}"]) && - intval($config['ipsec']["ipsec_{$lkey}"]) >= 0 && intval($config['ipsec']["ipsec_{$lkey}"]) <= 5) { - $forconfig ? $cfgtext[] = "${lkey} = " . (intval($config['ipsec']["ipsec_{$lkey}"]) - 1) : - mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} " . (intval($config['ipsec']["ipsec_{$lkey}"]) - 1) , false); + intval($config['ipsec']["ipsec_{$lkey}"]) >= 1 && intval($config['ipsec']["ipsec_{$lkey}"]) <= 6) { + $forconfig ? $cfgtext[] = "${lkey} = " . (intval($config['ipsec']["ipsec_{$lkey}"]) - 2) : + mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} " . (intval($config['ipsec']["ipsec_{$lkey}"]) - 2) , false); } } if ($forconfig) { diff --git a/usr/local/www/vpn_ipsec_settings.php b/usr/local/www/vpn_ipsec_settings.php index fc76fef..26e9005 100644 --- a/usr/local/www/vpn_ipsec_settings.php +++ b/usr/local/www/vpn_ipsec_settings.php @@ -294,8 +294,14 @@ function maxmss_checked(obj) { <td width="78%" valign="top" class="vncell"> <?php echo "<select name=\"ipsec_{$lkey}\" id=\"ipsec_{$lkey}\">\n"; foreach (array("Silent", "Audit", "Control", "Diag", "Raw", "Highest") as $lidx => $lvalue) { - echo "<option value=\"{$lidx}\" "; - if ($pconfig["ipsec_{$lkey}"] == $lidx) + $logval = $lidx + 1; + if (isset($pconfig["ipsec_{$lkey}"])) { + $logselected = $pconfig["ipsec_{$lkey}"]; + } else { + $logselected = "2"; + } + echo "<option value=\"{$logval}\" "; + if ($logselected == $logval) echo "selected=\"selected\""; echo ">{$lvalue}</option>\n"; } |