mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-22 10:41:23 +02:00
Correct use of $family in combined actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
4dc6be6b3b
commit
fe29adbd66
@ -31,22 +31,28 @@ DEFAULTS DROP,-
|
|||||||
?if __ADDRTYPE
|
?if __ADDRTYPE
|
||||||
@1 - - - ;; -m addrtype --dst-type BROADCAST
|
@1 - - - ;; -m addrtype --dst-type BROADCAST
|
||||||
@1 - - - ;; -m addrtype --dst-type ANYCAST
|
@1 - - - ;; -m addrtype --dst-type ANYCAST
|
||||||
?elseif __IPV4
|
?else
|
||||||
?begin perl;
|
?begin perl;
|
||||||
|
|
||||||
|
use strict;
|
||||||
use Shorewall::IPAddrs;
|
use Shorewall::IPAddrs;
|
||||||
use Shorewall::Config;
|
use Shorewall::Config;
|
||||||
use Shorewall::Chains;
|
use Shorewall::Chains;
|
||||||
|
|
||||||
my ( $action ) = get_action_params( 1 );
|
my ( $action, $audit ) = get_action_params( 2 );
|
||||||
my $chainref = get_action_chain;
|
my $chainref = get_action_chain;
|
||||||
my ( $level, $tag ) = get_action_logging;
|
my ( $level, $tag ) = get_action_logging;
|
||||||
|
|
||||||
|
fatal_error "Invalid parameter to action Broadcast" if supplied $audit && $audit ne 'audit';
|
||||||
|
|
||||||
my $target = require_audit ( $action , $audit );
|
my $target = require_audit ( $action , $audit );
|
||||||
|
|
||||||
if ( $family == F_IPv4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
add_commands $chainref, 'for address in $ALL_BCASTS; do';
|
add_commands $chainref, 'for address in $ALL_BCASTS; do';
|
||||||
} else {
|
} elsif ($family == F_IPV6 ) {
|
||||||
add_commands $chainref, 'for address in $ALL_ACASTS; do';
|
add_commands $chainref, 'for address in $ALL_ACASTS; do';
|
||||||
|
} else {
|
||||||
|
fatal_error "Internal error - \$family == $family";
|
||||||
}
|
}
|
||||||
|
|
||||||
incr_cmd_level $chainref;
|
incr_cmd_level $chainref;
|
||||||
|
@ -33,25 +33,22 @@ DEFAULTS DROP,-
|
|||||||
?else
|
?else
|
||||||
?begin perl;
|
?begin perl;
|
||||||
|
|
||||||
|
use strict;
|
||||||
use Shorewall::IPAddrs;
|
use Shorewall::IPAddrs;
|
||||||
use Shorewall::Config;
|
use Shorewall::Config;
|
||||||
use Shorewall::Chains;
|
use Shorewall::Chains;
|
||||||
|
|
||||||
my ( $action ) = get_action_params( 1 );
|
my ( $action, $audit ) = get_action_params( 2 );
|
||||||
my $chainref = get_action_chain;
|
my $chainref = get_action_chain;
|
||||||
my ( $level, $tag ) = get_action_logging;
|
my ( $level, $tag ) = get_action_logging;
|
||||||
|
|
||||||
fatal_error "Invalid parameter to action Broadcast" if supplied $audit && $audit ne 'audit';
|
fatal_error "Invalid parameter to action Multicast" if supplied $audit && $audit ne 'audit';
|
||||||
|
|
||||||
my $target = require_audit ( $action , $audit );
|
my $target = require_audit ( $action , $audit );
|
||||||
|
my $dest = ( $family == F_IPV4 ) ? join( ' ', '-d', IPv4_MULTICAST . ' ' ) : join( ' ', '-d', IPv6_MULTICAST . ' ' );
|
||||||
|
|
||||||
if ( $family == F_IPv4 ) {
|
log_rule_limit( $level, $chainref, 'Multicast' , $action, '', $tag, 'add', $dest ) if $level ne '';
|
||||||
log_rule_limit $level, $chainref, 'Multicast' , $action, '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
|
add_jump $chainref, $target, 0, $dest;
|
||||||
add_jump $chainref, $action, 0, '-d 224.0.0.0/4 ';
|
|
||||||
} else {
|
|
||||||
log_rule_limit( $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', join( ' ', '-d', IPv6_MULTICAST . ' ' ) ) if $level ne '';
|
|
||||||
add_jump $chainref, $target, 0, join( ' ', '-d', IPv6_MULTICAST . ' ' );
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
@ -86,6 +86,9 @@ our @EXPORT = qw(
|
|||||||
kernel_version
|
kernel_version
|
||||||
|
|
||||||
compiletime
|
compiletime
|
||||||
|
|
||||||
|
F_IPV4
|
||||||
|
F_IPV6
|
||||||
);
|
);
|
||||||
|
|
||||||
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
|
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
|
||||||
@ -196,9 +199,6 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
|
|||||||
|
|
||||||
PARMSMODIFIED
|
PARMSMODIFIED
|
||||||
USEDCALLER
|
USEDCALLER
|
||||||
|
|
||||||
F_IPV4
|
|
||||||
F_IPV6
|
|
||||||
|
|
||||||
TCP
|
TCP
|
||||||
UDP
|
UDP
|
||||||
@ -748,7 +748,7 @@ sub initialize( $;$$) {
|
|||||||
TC_SCRIPT => '',
|
TC_SCRIPT => '',
|
||||||
EXPORT => 0,
|
EXPORT => 0,
|
||||||
KLUDGEFREE => '',
|
KLUDGEFREE => '',
|
||||||
VERSION => "5.1.1-RC1",
|
VERSION => "5.1.4-Beta1",
|
||||||
CAPVERSION => 50100 ,
|
CAPVERSION => 50100 ,
|
||||||
BLACKLIST_LOG_TAG => '',
|
BLACKLIST_LOG_TAG => '',
|
||||||
RELATED_LOG_TAG => '',
|
RELATED_LOG_TAG => '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user