Firewall: DNAT - Show right DNAT interface in ruletable
[people/teissler/ipfire-2.x.git] / html / cgi-bin / firewall.cgi
index 436bdaf..d69d821 100644 (file)
@@ -989,6 +989,12 @@ sub deleterule
                &base;
        }
 }
+sub del_double
+{
+       my %all=();
+       @all{@_}=1;
+       return (keys %all);
+}
 sub disable_rule
 {
        my $key1=shift;
@@ -2551,9 +2557,22 @@ END
                                        <td align='center' $tdcolor>
 END
                        #Is this a DNAT rule?
+                       my $natstring;
                        if ($$hash{$key}[31] eq 'dnat' && $$hash{$key}[28] eq 'ON'){
                                if ($$hash{$key}[29] eq 'Default IP'){$$hash{$key}[29]=$Lang::tr{'red1'};}
-                               print "Firewall ($$hash{$key}[29])";
+                               if ($$hash{$key}[29] eq 'AUTO'){
+                                       my @src_addresses=&fwlib::get_addresses(\%$hash,$key,'src');
+                                       my @nat_ifaces;
+                                       foreach my $val (@src_addresses){
+                                               my ($ip,$sub)=split("/",$val);
+                                               push (@nat_ifaces,&fwlib::get_nat_address($$hash{$key}[29],$ip));
+                                       }
+                                       @nat_ifaces=&del_double(@nat_ifaces);
+                                       $natstring = join(', ', @nat_ifaces);
+                               }else{
+                                       $natstring = $$hash{$key}[29];
+                               }
+                               print "$Lang::tr{'firewall'} ($natstring)";
                                if($$hash{$key}[30] ne ''){
                                        $$hash{$key}[30]=~ tr/|/,/;
                                        print": $$hash{$key}[30]";