mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
firewall/rule engine, keep some behaviour from legacy code as long as we're not sure wrong data can enter the config. for https://github.com/opnsense/core/issues/1326
This commit is contained in:
parent
19c4253b1c
commit
12d174e79d
@ -63,7 +63,13 @@ class SNatRule extends Rule
|
||||
private function parseNatRules()
|
||||
{
|
||||
foreach ($this->reader() as $rule) {
|
||||
if (empty($rule['target'])) {
|
||||
if (!empty($rule['nonat'])) {
|
||||
// Just a precaution, when no nat is selected make sure we're not going to enter a target.
|
||||
// (keep behaviour from legacy code as long as we don't know for sure the fields are always empty)
|
||||
$rule['target'] = null;
|
||||
$rule['poolopts'] = null;
|
||||
$rule['staticnatport'] = null;
|
||||
} elseif (empty($rule['target'])) {
|
||||
$interf = $rule['interface'];
|
||||
if (!empty($this->interfaceMapping[$interf])) {
|
||||
if (($this->isIpV4($rule) && !empty($this->interfaceMapping[$interf]['ifconfig']['ipv4'])) ||
|
||||
@ -84,7 +90,7 @@ class SNatRule extends Rule
|
||||
$rule[$fieldname] = "$".$rule[$fieldname];
|
||||
}
|
||||
}
|
||||
if (!empty($rule['staticnatport'])) {
|
||||
if (!empty($rule['staticnatport']) || !empty($rule['nonat'])) {
|
||||
$rule['natport'] = '';
|
||||
} elseif (empty($rule['natport'])) {
|
||||
$rule['natport'] = "1024:65535";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user