From 6be32fe50454ded7ecbec877db3a05bd87bdcc05 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Sun, 31 Mar 2013 16:18:12 +0200 Subject: [PATCH] Forward Firewall: bugfix: DNAT now correctly creates rules, when customservice defined as target --- config/forwardfw/rules.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/forwardfw/rules.pl b/config/forwardfw/rules.pl index 2ce3efabbc..9af2c7060f 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'){ -- 2.39.5