mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
Fix maclist and enabled traffic shaping
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9022 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
4bc7d60f36
commit
37938296ed
@ -2053,7 +2053,7 @@ sub get_configuration( $ ) {
|
||||
default_yes_no 'ADD_SNAT_ALIASES' , '';
|
||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||
default_yes_no 'CLEAR_TC' , 'Yes';
|
||||
default_yes_no 'CLEAR_TC' , $family == F_IPV4 ? 'Yes' : '';
|
||||
|
||||
if ( defined $config{CLAMPMSS} ) {
|
||||
default_yes_no 'CLAMPMSS' , '' unless $config{CLAMPMSS} =~ /^\d+$/;
|
||||
@ -2150,7 +2150,7 @@ sub get_configuration( $ ) {
|
||||
$config{TCP_FLAGS_DISPOSITION} = 'DROP';
|
||||
}
|
||||
|
||||
default 'TC_ENABLED' , 'Internal';
|
||||
default 'TC_ENABLED' , $family == F_IPV4 ? 'Internal' : 'no';
|
||||
|
||||
$val = "\L$config{TC_ENABLED}";
|
||||
|
||||
|
@ -818,11 +818,11 @@ sub setup_mac_lists( $ ) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( $family == F_IPV4 ) {
|
||||
for my $interface ( @maclist_interfaces ) {
|
||||
my $chainref = $chain_table{$table}{( $ttl ? macrecent_target $interface : mac_chain $interface )};
|
||||
my $chain = $chainref->{name};
|
||||
|
||||
for my $interface ( @maclist_interfaces ) {
|
||||
my $chainref = $chain_table{$table}{( $ttl ? macrecent_target $interface : mac_chain $interface )};
|
||||
my $chain = $chainref->{name};
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
if ( $level ne '' || $disposition ne 'ACCEPT' ) {
|
||||
my $variable = get_interface_addresses source_port_to_bridge( $interface );
|
||||
|
||||
@ -859,7 +859,7 @@ sub setup_mac_lists( $ ) {
|
||||
add_command( $chainref, 'done' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
run_user_exit2( 'maclog', $chainref );
|
||||
|
||||
log_rule_limit $level, $chainref , $chain , $disposition, '', '', 'add', '' if $level ne '';
|
||||
|
@ -342,8 +342,6 @@ sub validate_tc_device( $$$$$ ) {
|
||||
|
||||
my $devnumber;
|
||||
|
||||
fatal_error "Traffic Shaping is not yet available in Shorewall6" if $family == F_IPV6;
|
||||
|
||||
if ( $device =~ /:/ ) {
|
||||
( my $number, $device, my $rest ) = split /:/, $device, 3;
|
||||
|
||||
@ -831,16 +829,18 @@ sub setup_traffic_shaping() {
|
||||
emit "fi\n";
|
||||
}
|
||||
|
||||
$fn = open_file 'tcfilters';
|
||||
if ( $family == F_IPV4 ) {
|
||||
$fn = open_file 'tcfilters';
|
||||
|
||||
if ( $fn ) {
|
||||
first_entry( sub { progress_message2 "$doing $fn..."; save_progress_message "Adding TC Filters"; } );
|
||||
if ( $fn ) {
|
||||
first_entry( sub { progress_message2 "$doing $fn..."; save_progress_message "Adding TC Filters"; } );
|
||||
|
||||
while ( read_a_line ) {
|
||||
|
||||
my ( $devclass, $source, $dest, $proto, $port, $sport ) = split_line 2, 6, 'tcfilters file';
|
||||
|
||||
while ( read_a_line ) {
|
||||
|
||||
my ( $devclass, $source, $dest, $proto, $port, $sport ) = split_line 2, 6, 'tcfilters file';
|
||||
|
||||
process_tc_filter( $devclass, $source, $dest, $proto, $port, $sport );
|
||||
process_tc_filter( $devclass, $source, $dest, $proto, $port, $sport );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
#
|
||||
# Shorewall version 4 - Tcfilters File
|
||||
#
|
||||
# For information about entries in this file, type "man shorewall-tcfilters"
|
||||
#
|
||||
# See http://shorewall.net/traffic_shaping.htm for additional information.
|
||||
#
|
||||
###############################################################################
|
||||
#INTERFACE: SOURCE DEST PROTO DEST SOURCE
|
||||
#CLASS PORT(S) PORT(S)
|
||||
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
|
Loading…
Reference in New Issue
Block a user