From 0efc0451c112430d7dccf035e4c68a7a94cbf528 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 7 Oct 2012 15:55:00 -0700 Subject: [PATCH] Allow IP range in the hosts file Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Zones.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index a803a2ff2..6bbb421ba 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -763,7 +763,11 @@ sub add_group_to_zone($$$$$) $new = \@exclusions; } - $host = validate_net( $host, 1 ) unless $host =~ /^\+/; + if ( $host =~ /-/ ) { + &validate_range( split('-', $host, 2 ) ) + } else { + $host = validate_net( $host, 1 ) unless $host =~ /^\+/; + } unless ( $switched ) { if ( $type == $zonetype ) {