From: Alexander Marx Date: Fri, 19 Mar 2021 17:27:24 +0000 (+0100) Subject: BUG12479: Copied NAT rule in Firewall displays incorrect source Port X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2FBUG12479;p=people%2Famarx%2Fipfire-2.x.git BUG12479: Copied NAT rule in Firewall displays incorrect source Port Fixes: #12479 When copying a NAT rule in the firewall the existing sourceport is copied, too. This Fix deletes the sourceport from a copied NAT rule. After Saving, the correct port is used. Signed-off-by: Alexander Marx --- diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 1483e779f..532f99f91 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -1552,6 +1552,11 @@ sub newrule $fwdfwsettings{'USE_NAT'} = $hash{$key}[28]; $fwdfwsettings{'nat'} = $hash{$key}[31]; #changed order $fwdfwsettings{$fwdfwsettings{'nat'}} = $hash{$key}[29]; + #Fix BUG 12479 + #When copying a DNAT Rule, the sourceport has to be empty at this point. + if($hash{$key}[14] eq 'cust_srv' and $hash{$key}[31] eq 'dnat'){ + $hash{$key}[30] = ''; + } $fwdfwsettings{'dnatport'} = $hash{$key}[30]; $fwdfwsettings{'LIMIT_CON_CON'} = $hash{$key}[32]; $fwdfwsettings{'concon'} = $hash{$key}[33];