forked from extern/shorewall_code
Fix iprange handling in IPv6 rules
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9067 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
ddf7887139
commit
8c92588e14
@ -596,7 +596,7 @@ sub use_forward_chain($) {
|
||||
#
|
||||
# Interface associated with a single zone -- Must use the interface chain if
|
||||
# the zone has multiple interfaces
|
||||
#
|
||||
# and this chain has option rules
|
||||
$interfaceref->{options}{use_forward_chain} && keys %{ zone_interfaces( $zone ) } > 1;
|
||||
}
|
||||
|
||||
@ -1565,7 +1565,8 @@ sub match_source_net( $;$ ) {
|
||||
|
||||
$restriction |= NO_RESTRICT;
|
||||
|
||||
if ( $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ) {
|
||||
if ( $family == F_IPV4 && $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ||
|
||||
$family == F_IPV6 && $net =~ /^(!?)(.*:.*)-(.*:.*)$/ ) {
|
||||
my ($addr1, $addr2) = ( $2, $3 );
|
||||
$net =~ s/!// if my $invert = $1 ? '! ' : '';
|
||||
validate_range $addr1, $addr2;
|
||||
@ -1591,7 +1592,8 @@ sub match_source_net( $;$ ) {
|
||||
sub match_dest_net( $ ) {
|
||||
my $net = $_[0];
|
||||
|
||||
if ( $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ) {
|
||||
if ( $family == F_IPV4 && $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ||
|
||||
$family == F_IPV6 && $net =~ /^(!?)(.*:.*)-(.*:.*)$/ ) {
|
||||
my ($addr1, $addr2) = ( $2, $3 );
|
||||
$net =~ s/!// if my $invert = $1 ? '! ' : '';
|
||||
validate_range $addr1, $addr2;
|
||||
|
@ -624,6 +624,8 @@ sub add_common_rules() {
|
||||
|
||||
for $interface ( @$list ) {
|
||||
set_interface_option $interface, 'use_input_chain', 1;
|
||||
set_interface_option $interface, 'use_forward_chain', 1;
|
||||
|
||||
for $chain ( input_chain $interface, output_chain $interface ) {
|
||||
add_rule $filter_table->{$chain} , "-p udp --dport $ports -j ACCEPT";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user