mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
Firewall, rule parsing, disable empty port aliases to avoid rule loading issues, related to https://github.com/opnsense/core/issues/1858
This commit is contained in:
parent
eeb14c29fc
commit
c76006cd5e
@ -263,6 +263,10 @@ abstract class Rule
|
||||
$rule[$target."_port"] = $port;
|
||||
} elseif (Util::isAlias($port)) {
|
||||
$rule[$target."_port"] = '$'.$port;
|
||||
if (!Util::isAlias($port, true)) {
|
||||
// unable to map port
|
||||
$rule['disabled'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($rule[$target])) {
|
||||
|
||||
@ -98,6 +98,10 @@ class SNatRule extends Rule
|
||||
foreach (array("sourceport", "dstport", "natport") as $fieldname) {
|
||||
if (!empty($rule[$fieldname]) && Util::isAlias($rule[$fieldname])) {
|
||||
$rule[$fieldname] = "$".$rule[$fieldname];
|
||||
if (!Util::isAlias($rule[$fieldname], true)) {
|
||||
// unable to map port
|
||||
$rule['disabled'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($rule['staticnatport']) || !empty($rule['nonat'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user