summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2013-01-24 10:37:45 +0000
committerErmal Luçi <eri@pfsense.org>2013-01-24 10:37:45 +0000
commit18f338da58e4f98478bd4710b3f4907759cd9540 (patch)
tree0ef51cab860b81bf8cb70b4544a455f094ad09be /usr/local/www/interfaces.php
parent80fae0e29752c235ffe1b580ba74796a8ca48902 (diff)
downloadpfsense-18f338da58e4f98478bd4710b3f4907759cd9540.zip
pfsense-18f338da58e4f98478bd4710b3f4907759cd9540.tar.gz
Correctly bring down an interface older configuration. Fixes #2758
Diffstat (limited to 'usr/local/www/interfaces.php')
-rwxr-xr-xusr/local/www/interfaces.php30
1 files changed, 6 insertions, 24 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index efed8d2..ee45bfb 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -354,19 +354,9 @@ if ($_POST['apply']) {
if (file_exists("{$g['tmp_path']}/.interfaces.apply")) {
$toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.interfaces.apply"));
- foreach ($toapplylist as $ifapply => $values) {
- if (isset($config['interfaces'][$ifapply]['enable'])) {
- /* check if any old addresses need purging */
- if(is_ipaddrv6($values['ipaddrv6'])) {
- $realif = get_real_interface("$ifapply");
- log_error("removing old v6 address {$values['ipaddrv6']} on {$realif}");
- mwexec("/sbin/ifconfig {$realif} inet6 {$values['ipaddrv6']} -alias");
- }
- interface_reconfigure($ifapply, true);
- } else {
-
- interface_bring_down($ifapply);
- }
+ foreach ($toapplylist as $ifapply => $ifcfgo) {
+ interface_bring_down($ifapply, false, $ifcfgo);
+ interface_configure($ifapply);
}
}
/* restart snmp so that it binds to correct address */
@@ -375,7 +365,7 @@ if ($_POST['apply']) {
/* sync filter configuration */
setup_gateways_monitor();
- clear_subsystem_dirty('staticroutes');
+ clear_subsystem_dirty('interfaces');
filter_configure();
@@ -395,11 +385,8 @@ if ($_POST['apply']) {
} else {
$toapplylist = array();
}
- $toapplylist[$if] = array();
+ $toapplylist[$if] = $wancfg;
/* we need to be able remove IP aliases for IPv6 */
- if(($old_wancfg['ipaddrv6'] != $wancfg['ipaddrv6']) && (is_ipaddrv6($old_wancfg['ipaddrv6']))) {
- $toapplylist[$if]['ipaddrv6'] = "{$old_wancfg['ipaddrv6']}";
- }
file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist));
header("Location: interfaces.php?if={$if}");
exit;
@@ -897,12 +884,7 @@ if ($_POST['apply']) {
} else {
$toapplylist = array();
}
- $toapplylist[$if] = array();
- /* we need to be able remove IP aliases for IPv6 */
- if(($old_wancfg['ipaddrv6'] != $wancfg['ipaddrv6']) && (is_ipaddrv6($old_wancfg['ipaddrv6']))) {
- $toapplylist[$if]['ipaddrv6'] = $old_wancfg['ipaddrv6'];
- }
-
+ $toapplylist[$if] = $old_wancfg;
file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist));
mark_subsystem_dirty('interfaces');
OpenPOWER on IntegriCloud