mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
Filter: associated nat rules miss state keyword and when they would, the tag wouldn't be processed properly ($rule['type'] --> pass)
The associated nat rules remain a terrible construct, ideally we would make sure the automated rule matches a regular one, but if they do, the firewall_rules_edit.php page has to handle all sorts of corner cases leading to other unexpected behaviour. This fixes a bug, cleaning this up would either need proper validations in the filter page or no extra validations at all (create/update, only note the relation, but don't try to enforce anything when associated-rule-id is set.
This commit is contained in:
parent
9ad7e5463f
commit
4235c72900
@ -205,7 +205,7 @@ class FilterRule extends Rule
|
||||
}
|
||||
}
|
||||
// restructure state settings for easier output parsing
|
||||
if (!empty($rule['statetype']) && $rule['type'] == 'pass') {
|
||||
if (!empty($rule['statetype']) && ($rule['type'] == 'pass' || empty($rule['type']))) {
|
||||
$rule['state'] = array('type' => 'keep', 'options' => array());
|
||||
switch ($rule['statetype']) {
|
||||
case 'none':
|
||||
|
||||
@ -288,6 +288,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
|
||||
// Update interface, protocol and destination
|
||||
$filterent['interface'] = $natent['interface'];
|
||||
$filterent['statetype'] = "keep state";
|
||||
if (!empty($natent['protocol'])) {
|
||||
$filterent['protocol'] = $natent['protocol'];
|
||||
} elseif (isset($filterent['protocol'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user