mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
Firewall: Added new feature: Now protocols can be added to servicegroups (GRE,AH,ESP,IPIP,IPV6)
This commit is contained in:
@@ -90,7 +90,10 @@ sub get_srvgrp_prot
|
||||
$udp=1;
|
||||
}elsif(&get_srv_prot($customservicegrp{$key}[2]) eq 'ICMP'){
|
||||
$icmp=1;
|
||||
}
|
||||
}else{
|
||||
#Protocols used in servicegroups
|
||||
push (@ips,$customservicegrp{$key}[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($tcp eq '1'){push (@ips,'TCP');}
|
||||
|
||||
@@ -252,6 +252,9 @@ sub buildrules
|
||||
#print rules to console
|
||||
foreach my $DPROT (@DPROT){
|
||||
$DPORT = &get_port($hash,$key,$DPROT);
|
||||
if ($DPROT ne 'TCP' && $DPROT ne 'UDP' && $DPROT ne 'ICMP' ){
|
||||
$DPORT='';
|
||||
}
|
||||
$PROT=$DPROT;
|
||||
$PROT="-p $PROT" if ($PROT ne '' && $PROT ne ' ');
|
||||
foreach my $a (sort keys %sourcehash){
|
||||
@@ -333,6 +336,9 @@ sub buildrules
|
||||
$DPORT = &get_port($hash,$key,$DPROT);
|
||||
$PROT=$DPROT;
|
||||
$PROT="-p $PROT" if ($PROT ne '' && $PROT ne ' ');
|
||||
if ($DPROT ne 'TCP' && $DPROT ne'UDP' && $DPROT ne 'ICMP' ){
|
||||
$DPORT='';
|
||||
}
|
||||
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'){
|
||||
|
||||
Reference in New Issue
Block a user