mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-08 22:16:09 +02:00
Firewall: fix senseless if clause in rulecreation
This commit is contained in:
@@ -256,7 +256,7 @@ sub buildrules
|
|||||||
foreach my $a (sort keys %sourcehash){
|
foreach my $a (sort keys %sourcehash){
|
||||||
foreach my $b (sort keys %targethash){
|
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'){
|
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'){
|
||||||
if($DPROT eq ' ' || $DPROT ne ''){
|
if($DPROT ne ''){
|
||||||
if(substr($sourcehash{$a}[0], 3, 3) ne 'mac' && $sourcehash{$a}[0] ne ''){ $STAG="-s";}
|
if(substr($sourcehash{$a}[0], 3, 3) ne 'mac' && $sourcehash{$a}[0] ne ''){ $STAG="-s";}
|
||||||
if(substr($DPORT, 2, 4) eq 'icmp'){
|
if(substr($DPORT, 2, 4) eq 'icmp'){
|
||||||
my @icmprule= split(",",substr($DPORT, 12,));
|
my @icmprule= split(",",substr($DPORT, 12,));
|
||||||
@@ -315,7 +315,7 @@ sub buildrules
|
|||||||
foreach my $a (sort keys %sourcehash){
|
foreach my $a (sort keys %sourcehash){
|
||||||
foreach my $b (sort keys %targethash){
|
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'){
|
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'){
|
||||||
if($DPROT ne '' || $DPROT eq ' '){
|
if($DPROT ne ''){
|
||||||
if(substr($sourcehash{$a}[0], 3, 3) ne 'mac' && $sourcehash{$a}[0] ne ''){ $STAG="-s";}
|
if(substr($sourcehash{$a}[0], 3, 3) ne 'mac' && $sourcehash{$a}[0] ne ''){ $STAG="-s";}
|
||||||
#Process ICMP RULE
|
#Process ICMP RULE
|
||||||
if(substr($DPORT, 2, 4) eq 'icmp'){
|
if(substr($DPORT, 2, 4) eq 'icmp'){
|
||||||
|
|||||||
Reference in New Issue
Block a user