From 44088ce83aff8b3c1bb5ead1ccd7eeb56e3b2ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 23 Feb 2010 22:56:11 +0000 Subject: [PATCH] Ticket #356. Clear the interface configuration if neccessary. To avoid strange situation described in the ticket. --- usr/local/www/interfaces_assign.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 66cb0d0990..04b9979466 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -188,9 +188,11 @@ if ($_POST['apply']) { if (!is_array($ifport)) { $reloadif = false; - if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] <> $ifport) + if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] <> $ifport) { + interface_bring_down($ifname); /* Mark this to be reconfigured in any case. */ $reloadif = true; + } $config['interfaces'][$ifname]['if'] = $ifport; if (preg_match('/^ppp_(.+)$/', $ifport, $matches)) { $config['interfaces'][$ifname]['pointtopoint'] = true;