Forward Firewall: fixed converter bug: Remark is "0" and Alias ip is taken as ip...
[people/teissler/ipfire-2.x.git] / config / forwardfw / convert-portfw
index 682199f0046746c6425b3a620be0ac48058a189d..8ec3c34382dda3d782300e649d46ea51b0490fdd 100755 (executable)
@@ -85,14 +85,15 @@ sub build_rules
                }else{
                        foreach my $ali (@alias){
                                my ($alias_ip,$alias_active,$alias_name) = split (",",$ali);
-                               if($alias eq $alias_name){
+                               if($alias eq $alias_ip){
+                                       chomp($alias_name);
                                        $alias=$alias_name;
                                }
                        }
                }
                $active = uc $active;
                $prot   = uc $prot;
-               $remark = chomp($remark);
+               chomp($remark);
                push (@built_rules,"ACCEPT,NAT_DESTINATION,$active,$src,$src1,tgt_addr,$target/32,ON,$prot,,TGT_PORT,$targetport,$remark,00:00,00:00,ON,$alias,$ipfireport,dnat");
                my $now=localtime;
                print LOG "$now    Converted-> KEY: $count ACCEPT,NAT_DESTINATION,$active,$src,$src1,tgt_addr,$target/32,ON,$prot,,TGT_PORT,$targetport,$remark,00:00,00:00,ON,$alias,$ipfireport,dnat\n";