Forward Firewall: implemented ne column in ruletable "protocol"

This commit is contained in:
Alexander Marx
2013-01-19 14:09:50 +01:00
committed by Michael Tremer
parent 8b3dd79147
commit 93a5f4a582
2 changed files with 62 additions and 18 deletions

View File

@@ -340,7 +340,11 @@ sub get_port
if ($$hash{$key}[7] eq 'ON' && $SRC_TGT eq 'SRC'){
if ($$hash{$key}[10] ne ''){
$$hash{$key}[10] =~ s/\|/,/g;
return "-m multiport --sport $$hash{$key}[10] ";
if(index($$hash{$key}[10],",") > 0){
return "-m multiport --sport $$hash{$key}[10] ";
}else{
return "--sport $$hash{$key}[10] ";
}
}elsif($$hash{$key}[9] ne '' && $$hash{$key}[9] ne 'All ICMP-Types'){
return "--icmp-type $$hash{$key}[9] ";
}elsif($$hash{$key}[9] eq 'All ICMP-Types'){
@@ -351,7 +355,11 @@ sub get_port
if($$hash{$key}[14] eq 'TGT_PORT'){
if ($$hash{$key}[15] ne ''){
$$hash{$key}[15] =~ s/\|/,/g;
return "-m multiport --dport $$hash{$key}[15] ";
if(index($$hash{$key}[15],",") > 0){
return "-m multiport --dport $$hash{$key}[15] ";
}else{
return "--dport $$hash{$key}[15] ";
}
}elsif($$hash{$key}[13] ne '' && $$hash{$key}[13] ne 'All ICMP-Types'){
return "--icmp-type $$hash{$key}[13] ";
}elsif($$hash{$key}[13] ne '' && $$hash{$key}[13] eq 'All ICMP-Types'){