From 9dd66fc6ff677cb88065e0e784a083e83d310e68 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 c90fc8fac..ec5017752 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -764,7 +764,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 ) {