summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-06-10 00:07:15 +0700
committergnhb <gnoahb@gmail.com>2010-06-10 00:07:15 +0700
commitd09ca87e5e46766eda92aeb41cfcb3ea7645851a (patch)
treedfdb2d65a19e45a3dadceb0868e8892affd5dbd8 /etc
parent33d2e5106bdec5baacdadda13d403f8cc6da9ce3 (diff)
downloadpfsense-d09ca87e5e46766eda92aeb41cfcb3ea7645851a.zip
pfsense-d09ca87e5e46766eda92aeb41cfcb3ea7645851a.tar.gz
Fix up upgrade function for new PPPs implementation.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/upgrade_config.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index a305f1b..2bd25ed 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1973,9 +1973,14 @@ function upgrade_062_to_063() {
function upgrade_063_to_064() {
global $config;
- $i=0;
+ $j=0;
+ $ifcfg = &$config['interfaces'];
+
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
+ $config['ppps']['ppp'][$pppid]['if'] = "ppp".$j;
+ $config['ppps']['ppp'][$pppid]['ptpid'] = $j;
+ $j++;
if (isset($ppp['port'])){
$config['ppps']['ppp'][$pppid]['ports'] = $ppp['port'];
unset($config['ppps']['ppp'][$pppid]['port']);
@@ -1983,17 +1988,11 @@ function upgrade_063_to_064() {
if (!isset($ppp['type'])){
$config['ppps']['ppp'][$pppid]['type'] = "ppp";
}
- if (!isset($ppp['ptpid'])){
- $config['ppps']['ppp'][$pppid]['ptpid'] = $i;
- $i++;
- }
if (isset($ppp['defaultgw']))
unset($config['ppps']['ppp'][$pppid]['defaultgw']);
}
}
- $ifcfg = &$config['interfaces'];
-
if (!is_array($config['ppps']['ppp']))
$config['ppps']['ppp'] = array();
$a_ppps = &$config['ppps']['ppp'];
@@ -2004,9 +2003,9 @@ function upgrade_063_to_064() {
if ($ifinfo['ipaddr'] == "pppoe" || $ifinfo['ipaddr'] == "pptp"){
if (isset($ifinfo['ptpid']))
continue;
- $ppp['ptpid'] = $i;
+ $ppp['ptpid'] = $j;
$ppp['type'] = $ifinfo['ipaddr'];
- $ppp['if'] = $ifinfo['ipaddr'].$i;
+ $ppp['if'] = $ifinfo['ipaddr'].$j;
$ppp['ports'] = $ifinfo['if'];
if ($ifinfo['ipaddr'] == "pppoe"){
$ppp['username'] = $ifinfo['pppoe_username'];
@@ -2040,8 +2039,8 @@ function upgrade_063_to_064() {
if (isset($ifinfo['remote']))
$ppp['gateway'] = $ifinfo['remote'];
- $ifcfg[$ifname]['if'] = $ifinfo['ipaddr'].$i;
- $i++;
+ $ifcfg[$ifname]['if'] = $ifinfo['ipaddr'].$j;
+ $j++;
unset($ifcfg[$ifname]['pppoe_username']);
unset($ifcfg[$ifname]['pppoe_password']);
OpenPOWER on IntegriCloud