forked from extern/shorewall_code
A little optimization of maclist code
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6106 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
ef12a3c681
commit
a19ed69ef5
@ -746,7 +746,7 @@ sub setup_mac_lists( $ ) {
|
|||||||
my $chainref = $chain_table{$table}{( $config{MACLIST_TTL} ? macrecent_target $interface : mac_chain $interface )};
|
my $chainref = $chain_table{$table}{( $config{MACLIST_TTL} ? macrecent_target $interface : mac_chain $interface )};
|
||||||
my $chain = $chainref->{name};
|
my $chain = $chainref->{name};
|
||||||
|
|
||||||
if ( $config{MACLIST_LOG_LEVEL} ne '' || $config{MACLIST_DISPOSITION} ne 'ACCEPT' ) {
|
if ( $level ne '' || $disposition ne 'ACCEPT' ) {
|
||||||
my $variable = get_interface_addresses $interface;
|
my $variable = get_interface_addresses $interface;
|
||||||
add_command $chainref, "for address in $variable; do";
|
add_command $chainref, "for address in $variable; do";
|
||||||
add_command $chainref, " echo \"-A $chainref->{name} -s \$address -m addrtype --dst-type BROADCAST -j RETURN\" >&3";
|
add_command $chainref, " echo \"-A $chainref->{name} -s \$address -m addrtype --dst-type BROADCAST -j RETURN\" >&3";
|
||||||
@ -756,7 +756,7 @@ sub setup_mac_lists( $ ) {
|
|||||||
|
|
||||||
add_file $chainref, 'maclog';
|
add_file $chainref, 'maclog';
|
||||||
|
|
||||||
log_rule_limit $level, $chainref , $chain , $disposition, '', '', 'add', '' if $config{MACLIST_LOG_LEVEL} ne '';
|
log_rule_limit $level, $chainref , $chain , $disposition, '', '', 'add', '' if $level ne '';
|
||||||
add_rule $chainref, "-j $target";
|
add_rule $chainref, "-j $target";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user