]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/forwardfw/rules.pl
Firewall: fix rules.pl when using custom hosts/networks and services no rule was...
[people/teissler/ipfire-2.x.git] / config / forwardfw / rules.pl
index 3abe02bab47f574446b7cfe5cf07623738375d51..fcaade2d6632f3416ff742b161642e8c72c73ba7 100755 (executable)
@@ -252,7 +252,7 @@ sub buildrules
                                foreach my $DPROT (@DPROT){
                                        $DPORT = &get_port($hash,$key,$DPROT);
                                        $PROT=$DPROT;
-                                       $PROT="-p $PROT" if ($PROT ne '');
+                                       $PROT="-p $PROT" if ($PROT ne '' && $PROT ne ' ');
                                        foreach my $a (sort keys %sourcehash){
                                                foreach my $b (sort keys %targethash){
                                                        if ($sourcehash{$a}[0] ne $targethash{$b}[0] && $targethash{$b}[0] ne 'none' || $sourcehash{$a}[0] eq '0.0.0.0/0.0.0.0'){
@@ -311,7 +311,7 @@ sub buildrules
                                foreach my $DPROT (@DPROT){
                                        $DPORT = &get_port($hash,$key,$DPROT);
                                        $PROT=$DPROT;
-                                       $PROT="-p $PROT" if ($PROT ne '');
+                                       $PROT="-p $PROT" if ($PROT ne '' && $PROT ne ' ');
                                        foreach my $a (sort keys %sourcehash){
                                                foreach my $b (sort keys %targethash){
                                                        if ($sourcehash{$a}[0] ne $targethash{$b}[0] && $targethash{$b}[0] ne 'none' || $sourcehash{$a}[0] eq '0.0.0.0/0.0.0.0'){