Commit e4752fac authored by Ad Schellevis's avatar Ad Schellevis

(legacy) some more cleanups interfaces_assign.php

parent 8c182ca4
...@@ -268,9 +268,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -268,9 +268,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
/* No errors detected, so update the config */ /* No errors detected, so update the config */
$changes = 0;
foreach ($_POST as $ifname => $ifport) { foreach ($_POST as $ifname => $ifport) {
if ($ifname == 'lan' || $ifname == 'wan' || substr($ifname, 0, 3) == 'opt') { if (!is_array($ifport) && ($ifname == 'lan' || $ifname == 'wan' || substr($ifname, 0, 3) == 'opt')) {
if (!is_array($ifport)) {
$reloadif = false; $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); interface_bring_down($ifname);
...@@ -310,11 +310,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -310,11 +310,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} }
/* Reload all for the interface. */ /* Reload all for the interface. */
interface_configure($ifname, true); interface_configure($ifname, true);
// reload filter (original from apply action) // count changes
filter_configure(); $changes++;
} }
} }
} }
if ($changes > 0) {
// reload filter when interfaces have changed (original from apply action)
filter_configure();
} }
write_config(); write_config();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment