From a31ec3c1eca61a55684f0604ecb041277fb93c8f Mon Sep 17 00:00:00 2001 From: Nikolay Denev <46969469+nikolay-te@users.noreply.github.com> Date: Thu, 12 Aug 2021 17:43:33 +0300 Subject: [PATCH] Allow to specify port ranges for outgoing NAT. (#4748) This allows to specify port ranges for NAT which is a valid pf configuration. --- src/www/firewall_nat_out_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/www/firewall_nat_out_edit.php b/src/www/firewall_nat_out_edit.php index 40f0cac6d..6605ad65f 100644 --- a/src/www/firewall_nat_out_edit.php +++ b/src/www/firewall_nat_out_edit.php @@ -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."); } }