forked from extern/shorewall_code
Fix service validation
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8332 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
3bf59ff03a
commit
942d6bf6f5
@ -256,7 +256,7 @@ sub validate_port( $$ ) {
|
||||
if ( $port =~ /^(\d+)$/ ) {
|
||||
return $port if $port <= 65535;
|
||||
} else {
|
||||
$proto = getprotobyname $proto if $proto =~ /^(\d+)$/;
|
||||
$proto = getprotobynumber $proto if $proto =~ /^(\d+)$/;
|
||||
$value = getservbyname( $port, $proto );
|
||||
}
|
||||
|
||||
|
@ -569,14 +569,28 @@ sub process_tc_filter( $$$$$$ ) {
|
||||
" flowid $devref->{number}:$class" ,
|
||||
'' );
|
||||
} else {
|
||||
our $lastrule;
|
||||
our $lasttnum;
|
||||
#
|
||||
# In order to be able to access the protocol header, we must create another hash table and link to it.
|
||||
#
|
||||
# Create the Table.
|
||||
#
|
||||
my $tnum = in_hex3 $devref->{tablenumber}++;
|
||||
my $tnum;
|
||||
|
||||
if ( $lastrule eq $rule ) {
|
||||
#
|
||||
# The source, dest and protocol are the same as the last rule that specified a port
|
||||
# Use the same table
|
||||
#
|
||||
$tnum = $lasttnum
|
||||
} else {
|
||||
$tnum = in_hex3 $devref->{tablenumber}++;
|
||||
$lasttnum = $tnum;
|
||||
$lastrule = $rule;
|
||||
|
||||
emit( "\nrun_tc filter add dev $device parent $devnum:0 protocol ip pref 10 handle $tnum: u32 divisor 1" );
|
||||
}
|
||||
#
|
||||
# And link to it using the current contents of $rule
|
||||
#
|
||||
@ -664,6 +678,8 @@ sub process_tc_filter( $$$$$$ ) {
|
||||
}
|
||||
|
||||
sub setup_traffic_shaping() {
|
||||
our $lastrule = '';
|
||||
|
||||
save_progress_message "Setting up Traffic Control...";
|
||||
|
||||
my $fn = open_file 'tcdevices';
|
||||
|
Loading…
Reference in New Issue
Block a user