From faee6cd640907a350331534e6aaad563e729b4d8 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sat, 20 Aug 2005 20:53:43 +0000 Subject: config fix for those bit by bug #393 This will remove all empty (or otherwise bogus) entries from the config file --- etc/inc/config.inc | 15 +++++++++++++++ etc/inc/globals.inc | 4 ++-- 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 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 +?> -- cgit v1.1