From e12ad49f4621ec9e99ca829c2d7188ad456638f8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 4 Mar 2013 09:57:28 -0300 Subject: Save ppp info and realif on interfaces.apply to be able to cleanup old configuration when changing interface type. Fixes #2758 --- usr/local/www/interfaces.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 2f6fd48..eef3f9f 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -86,6 +86,8 @@ $a_gateways = &$config['gateways']['gateway_item']; $wancfg = &$config['interfaces'][$if]; $old_wancfg = $wancfg; +$old_wancfg['realif'] = get_real_interface($if); +$old_ppps = $a_ppps; // Populate page descr if it does not exist. if ($if == "wan" && !$wancfg['descr']) $wancfg['descr'] = "WAN"; @@ -399,7 +401,8 @@ if ($_POST['apply']) { } else { $toapplylist = array(); } - $toapplylist[$if] = $wancfg; + $toapplylist[$if]['ifcfg'] = $wancfg; + $toapplylist[$if]['ppps'] = $a_ppps; /* we need to be able remove IP aliases for IPv6 */ file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist)); header("Location: interfaces.php?if={$if}"); @@ -929,7 +932,8 @@ if ($_POST['apply']) { } else { $toapplylist = array(); } - $toapplylist[$if] = $old_wancfg; + $toapplylist[$if]['ifcfg'] = $old_wancfg; + $toapplylist[$if]['ppps'] = $old_ppps; file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist)); mark_subsystem_dirty('interfaces'); -- cgit v1.1