From: Alexander Marx Date: Sun, 31 Mar 2013 14:18:12 +0000 (+0200) Subject: Forward Firewall: bugfix: DNAT now correctly creates rules, when customservice define... X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=6be32fe50454ded7ecbec877db3a05bd87bdcc05 Forward Firewall: bugfix: DNAT now correctly creates rules, when customservice defined as target --- diff --git a/config/forwardfw/rules.pl b/config/forwardfw/rules.pl index 2ce3efabb..9af2c7060 100755 --- a/config/forwardfw/rules.pl +++ b/config/forwardfw/rules.pl @@ -539,7 +539,11 @@ sub get_port } }elsif($$hash{$key}[14] eq 'cust_srv'){ if ($prot ne 'ICMP'){ - return "--dport ".&fwlib::get_srv_port($$hash{$key}[15],1,$prot); + if($$hash{$key}[31] eq 'dnat'){ + return ":".&fwlib::get_srv_port($$hash{$key}[15],1,$prot); + }else{ + return "--dport ".&fwlib::get_srv_port($$hash{$key}[15],1,$prot); + } }elsif($prot eq 'ICMP' && $$hash{$key}[15] ne 'All ICMP-Types'){ return "--icmp-type ".&fwlib::get_srv_port($$hash{$key}[15],3,$prot); }elsif($prot eq 'ICMP' && $$hash{$key}[15] eq 'All ICMP-Types'){