Skip to content

Commit

Permalink
Reload filter rules after reassigning an interface. Fixes #12949
Browse files Browse the repository at this point in the history
  • Loading branch information
vktg committed Mar 22, 2022
1 parent abddfcd commit d1d1084
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/usr/local/www/interfaces_assign.php
Expand Up @@ -223,6 +223,8 @@ interface_sync_wireless_clones($config['interfaces'][$newifname], false);

write_config("New interface assigned");

filter_configure();

$action_msg = gettext("Interface has been added.");
$class = "success";
}
Expand Down Expand Up @@ -302,6 +304,7 @@ interface_sync_wireless_clones($config['interfaces'][$newifname], false);

if (!$input_errors) {
/* No errors detected, so update the config */
$filter_reload = false;
foreach ($_POST as $ifname => $ifport) {

if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt')) {
Expand All @@ -312,6 +315,7 @@ interface_sync_wireless_clones($config['interfaces'][$newifname], false);
interface_bring_down($ifname);
/* Mark this to be reconfigured in any case. */
$reloadif = true;
$filter_reload = true;
}
$config['interfaces'][$ifname]['if'] = $ifport;
if (isset($portlist[$ifport]['isppp'])) {
Expand Down Expand Up @@ -346,10 +350,16 @@ interface_sync_wireless_clones($config['interfaces'][$ifname], false);
}
/* Reload all for the interface. */
interface_configure($ifname, true);
$filter_reload = true;
}
}
}
}
/* regenerated ruleset after re-assigning the interface,
* see https://redmine.pfsense.org/issues/12949 */
if ($filter_reload) {
filter_configure();
}
write_config("Interfaces assignment settings changed");

enable_rrd_graphing();
Expand Down Expand Up @@ -422,6 +432,8 @@ interface_bring_down($id); /* down the interface */

link_interface_to_vlans($realid, "update");

filter_configure();

$action_msg = gettext("Interface has been deleted.");
$class = "success";
}
Expand Down

0 comments on commit d1d1084

Please sign in to comment.