]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
BUG12479: Copied NAT rule in Firewall displays incorrect source Port
authorAlexander Marx <alexander.marx@ipfire.org>
Fri, 19 Mar 2021 17:32:19 +0000 (18:32 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Mar 2021 10:36:31 +0000 (10:36 +0000)
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 <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/firewall.cgi

index 1483e779ff22ba7b8db2c2309f0dc5788e3b3b53..532f99f9167ec36dcdbc71dd25b4f4077285b799 100644 (file)
@@ -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];