summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-08-20 20:53:43 +0000
committerBill Marquette <billm@pfsense.org>2005-08-20 20:53:43 +0000
commitfaee6cd640907a350331534e6aaad563e729b4d8 (patch)
tree99588d2aefa5ed071d2ca7a1cb02419b4d3d2803
parent135c91d517c82f349957536331921681c63ccef9 (diff)
downloadpfsense-faee6cd640907a350331534e6aaad563e729b4d8.zip
pfsense-faee6cd640907a350331534e6aaad563e729b4d8.tar.gz
config fix for those bit by bug #393
This will remove all empty (or otherwise bogus) <tunnel> entries from the config file
-rw-r--r--etc/inc/config.inc15
-rw-r--r--etc/inc/globals.inc4
2 files changed, 17 insertions, 2 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 712c456..3065100 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -666,6 +666,21 @@ function convert_config() {
$config['theme']="metallic";
$config['version'] = "1.9";
}
+ /* Convert 1.9 -> 1.10 */
+ if ($config['version'] == "1.9") {
+ if(is_array($config['ipsec']['tunnel'])) {
+ reset($config['ipsec']['tunnel']);
+ while (list($tunnel) = each($config['ipsec']['tunnel'])) {
+ /* Sanity check on required variables */
+ /* This fixes bogus <tunnel> entries - remnant of bug #393 */
+ if (!isset($tunnel['local-subnet']) && !isset($tunnel['remote-subnet'])) {
+ unset($config['ipsec']['tunnel'][$tunnel]);
+ }
+ }
+ }
+ $config['version'] = "1.10";
+ }
+
if ($prev_version != $config['version'])
write_config("Upgraded config version level from {$prev_version} to {$config['version']}");
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index 7570d63..003c2b4 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -52,7 +52,7 @@ $g = array(
"n_pppoe_units" => 16, /* this value can be overriden in pppoe->n_pppoe_units */
"pppoe_subnet" => 28, /* this value can be overriden in pppoe->pppoe_subnet */
"debug" => false,
- "latest_config" => "1.9",
+ "latest_config" => "1.10",
"nopkg_platforms" => array("cdrom"),
"nopccard_platforms" => array("wrap", "net48xx"),
"xmlrpcbaseurl" => "www.pfsense.com",
@@ -68,4 +68,4 @@ $iptos = array("lowdelay", "throughput", "reliability", "congestion");
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg");
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud