summaryrefslogtreecommitdiffstats
path: root/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-01-25 12:11:05 -0500
committerjim-p <jimp@pfsense.org>2012-01-25 12:11:37 -0500
commit48e24ada0f5ece11b9ffdfc4a3acb4b67aef09b6 (patch)
tree28df6dfbdf322c6a8e9b97ac2ec7c7a96bebc7b2 /etc/inc/upgrade_config.inc
parentc3ae41e674fdb4a0cec39ebffb008b565a68e19a (diff)
downloadpfsense-48e24ada0f5ece11b9ffdfc4a3acb4b67aef09b6.zip
pfsense-48e24ada0f5ece11b9ffdfc4a3acb4b67aef09b6.tar.gz
Fix upgrade code for 1.2.3 with assigned OpenVPN interface.
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r--etc/inc/upgrade_config.inc18
1 files changed, 8 insertions, 10 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 3c0c030..a2bca72 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1626,12 +1626,12 @@ function upgrade_051_to_052() {
if (!empty($server['custom_options'])) {
$cstmopts = array();
$tmpcstmopts = explode(";", $server['custom_options']);
- $assigned = false;
+ $assigned_if = "";
$tmpstr = "";
foreach ($tmpcstmopts as $tmpcstmopt) {
$tmpstr = str_replace(" ", "", $tmpcstmopt);
if (substr($tmpstr,0 ,6) == "devtun") {
- $assigned = true;
+ $assigned_if = substr($tmpstr, 3);
continue;
} else if (substr($tmpstr, 0, 5) == "local") {
$localip = substr($tmpstr, 5);
@@ -1640,10 +1640,9 @@ function upgrade_051_to_052() {
$cstmopts[] = $tmpcstmopt;
}
$server['custom_options'] = implode(";", $cstmopts);
- if ($assigned == true) {
- $realif = substr($tmpstr, 3);
+ if (!empty($assigned_if)) {
foreach ($config['interfaces'] as $iface => $cfgif) {
- if ($cfgif['if'] == $realif) {
+ if ($cfgif['if'] == $assigned_if) {
$config['interfaces'][$iface]['if'] = "ovpns{$server['vpnid']}";
break;
}
@@ -1728,12 +1727,12 @@ function upgrade_051_to_052() {
if (!empty($client['custom_options'])) {
$cstmopts = array();
$tmpcstmopts = explode(";", $client['custom_options']);
- $assigned = false;
+ $assigned_if = "";
$tmpstr = "";
foreach ($tmpcstmopts as $tmpcstmopt) {
$tmpstr = str_replace(" ", "", $tmpcstmopt);
if (substr($tmpstr,0 ,6) == "devtun") {
- $assigned = true;
+ $assigned_if = substr($tmpstr, 3);
continue;
} else if (substr($tmpstr, 0, 5) == "local") {
$localip = substr($tmpstr, 5);
@@ -1742,10 +1741,9 @@ function upgrade_051_to_052() {
$cstmopts[] = $tmpcstmopt;
}
$client['custom_options'] = implode(";", $cstmopts);
- if ($assigned == true) {
- $realif = substr($tmpstr, 3);
+ if (!empty($assigned_if)) {
foreach ($config['interfaces'] as $iface => $cfgif) {
- if ($cfgif['if'] == $realif) {
+ if ($cfgif['if'] == $assigned_if) {
$config['interfaces'][$iface]['if'] = "ovpnc{$client['vpnid']}";
break;
}
OpenPOWER on IntegriCloud