Allow to specify port ranges for outgoing NAT. (#4748)

This allows to specify port ranges for NAT which is a valid pf configuration.
This commit is contained in:
Nikolay Denev 2021-08-12 17:43:33 +03:00 committed by GitHub
parent 62bebdf335
commit a31ec3c1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,7 +162,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if(!empty($pconfig['dstport']) && !is_portrange($pconfig['dstport']) && !is_portoralias($pconfig['dstport'])) {
$input_errors[] = gettext("You must supply either a valid port or port alias for the destination port entry.");
}
if (!empty($pconfig['natport']) && !is_port($pconfig['natport']) && empty($pconfig['nonat'])) {
if (!empty($pconfig['natport']) && !(is_port($pconfig['natport']) || is_portrange($pconfig['natport'])) && empty($pconfig['nonat'])) {
$input_errors[] = gettext("You must supply a valid port for the NAT port entry.");
}
}