Make '+' optional in the ADD and DEL statements.

Signed-off-by: Tom Eastep <teastep@mint14.(none)>
This commit is contained in:
Tom Eastep 2013-01-06 07:37:11 -08:00
parent 3f24416f37
commit f223e3584c

View File

@ -2096,7 +2096,8 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
my ( $setname, $flags, $rest ) = split ':', $param, 3; my ( $setname, $flags, $rest ) = split ':', $param, 3;
fatal_error "Invalid ADD/DEL parameter ($param)" if $rest; fatal_error "Invalid ADD/DEL parameter ($param)" if $rest;
fatal_error "Expected ipset name ($setname)" unless $setname =~ s/^\+// && $setname =~ /^(6_)?[a-zA-Z][-\w]*$/; $setname =~ s/^\+//;
fatal_error "Expected ipset name ($setname)" unless $setname =~ /^(6_)?[a-zA-Z][-\w]*$/;
fatal_error "Invalid flags ($flags)" unless defined $flags && $flags =~ /^(dst|src)(,(dst|src)){0,5}$/; fatal_error "Invalid flags ($flags)" unless defined $flags && $flags =~ /^(dst|src)(,(dst|src)){0,5}$/;
$action = join( ' ', 'SET --' . $xlate{$basictarget} , $setname , $flags ); $action = join( ' ', 'SET --' . $xlate{$basictarget} , $setname , $flags );
} }