]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/forwardfw/rules.pl
Forward FIrewall: Bugfix: When using predefined services in rulecreation, the rule...
[people/teissler/ipfire-2.x.git] / config / forwardfw / rules.pl
index d62cca0d77dcb6f47a1d32206f3b5f0b54886a12..9f23c54e0a5b0fc47472919b9d2d34726f5fdbea 100755 (executable)
@@ -115,7 +115,7 @@ if($param eq 'flush'){
                        system ("/usr/sbin/firewall-policy"); 
                }elsif($fwdfwsettings{'POLICY'} eq 'MODE2'){
                        &p2pblock;
-                       system ("iptables -A $CHAIN -m state --state NEW -j ACCEPT");
+                       system ("iptables -A $CHAIN -m conntrack --ctstate NEW -j ACCEPT");
                        system ("/usr/sbin/firewall-policy");
                        system ("/etc/sysconfig/firewall.local reload");
                }
@@ -140,9 +140,6 @@ sub preparerules
        if (! -z  "${General::swroot}/forward/outgoing"){
                &buildrules(\%configoutgoingfw);
        }
-       if (! -z  "${General::swroot}/forward/nat"){
-               &buildrules(\%confignatfw);
-       }
 }
 sub buildrules
 {
@@ -578,7 +575,7 @@ sub get_port
                                                return "--dport $$hash{$key}[15] ";
                                         }else{
                                                 $$hash{$key}[15] =~ s/\:/-/g;
-                                               return ":$$hash{$key}[15]";
+                                                return ":$$hash{$key}[15]";
                                         }
                                }
                        }elsif($$hash{$key}[13] ne '' && $$hash{$key}[13] ne 'All ICMP-Types'){
@@ -588,7 +585,7 @@ sub get_port
                        }
                }elsif($$hash{$key}[14] eq 'cust_srv'){
                        if ($prot ne 'ICMP'){
-                               if($$hash{$key}[31] eq 'dnat'){
+                               if($$hash{$key}[31] eq 'dnat' && $$hash{$key}[28] eq 'ON'){
                                        return ":".&fwlib::get_srv_port($$hash{$key}[15],1,$prot);
                                }else{
                                        return "--dport ".&fwlib::get_srv_port($$hash{$key}[15],1,$prot);