Revert "Allow '-' in the interface for dynamic zone."

This reverts commit b68b34b820.
This commit is contained in:
Tom Eastep 2012-09-30 16:25:35 -07:00
parent 4ef81041be
commit 30d4ba67cc

View File

@ -891,14 +891,8 @@ sub is_a_bridge( $ ) {
# #
# Transform the passed interface name into a legal shell variable name. # Transform the passed interface name into a legal shell variable name.
# #
sub unclean_name( $$ ) { sub chain_base($) {
my ( $name, $allow_cash ) = @_; my $chain = $_[0];
$allow_cash ? $name =~ /[^-\w]/ : $name =~ /[^\w]/;
}
sub chain_base($;$) {
my ( $chain, $allow_dash ) = @_;
my $name = $basemap{$chain}; my $name = $basemap{$chain};
# #
# Return existing mapping, if any # Return existing mapping, if any
@ -914,7 +908,7 @@ sub chain_base($;$) {
$chain =~ s/\+$//; $chain =~ s/\+$//;
$chain =~ tr/./_/; $chain =~ tr/./_/;
if ( $chain eq '' || $chain =~ /^[0-9]/ || unclean_name( $chain, $allow_cash ) ) { if ( $chain eq '' || $chain =~ /^[0-9]/ || $chain =~ /[^\w]/ ) {
# #
# Must map. Remove all illegal characters # Must map. Remove all illegal characters
# #
@ -1845,7 +1839,7 @@ sub process_host( ) {
if ( $hosts eq 'dynamic' ) { if ( $hosts eq 'dynamic' ) {
fatal_error "Vserver zones may not be dynamic" if $type & VSERVER; fatal_error "Vserver zones may not be dynamic" if $type & VSERVER;
require_capability( 'IPSET_MATCH', 'Dynamic nets', ''); require_capability( 'IPSET_MATCH', 'Dynamic nets', '');
my $physical = chain_base( physical_name $interface , 1 ); my $physical = chain_base( physical_name $interface );
my $set = $family == F_IPV4 ? "${zone}_${physical}" : "6_${zone}_${physical}"; my $set = $family == F_IPV4 ? "${zone}_${physical}" : "6_${zone}_${physical}";
$hosts = "+$set"; $hosts = "+$set";
$optionsref->{dynamic} = 1; $optionsref->{dynamic} = 1;