mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Correct ipset creation and add a WARNING when creating an ipset
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c3b56d4123
commit
e38fcb2bfc
@ -6428,16 +6428,24 @@ sub ensure_ipset( $ ) {
|
|||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
if ( have_capability 'IPSET_V5' ) {
|
if ( have_capability 'IPSET_V5' ) {
|
||||||
emit ( " qt \$IPSET -L $set -n || \$IPSET -N $_ hash:ip family inet" );
|
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||||
|
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:ip set") ,
|
||||||
|
qq( \$IPSET -N $set hash:ip family inet") ,
|
||||||
|
qq( fi) );
|
||||||
} else {
|
} else {
|
||||||
emit ( " qt \$IPSET -L $set -n || \$IPSET -N $_ iphash" );
|
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||||
|
qq( error_message "WARNING: ipset $1 does not exist; creating it as an iphash set") ,
|
||||||
|
qq( \$IPSET -N $set iphash") ,
|
||||||
|
qq( fi) );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit ( " qt \$IPSET -L $set -n || \$IPSET -N $_ hash:ip family inet6" );
|
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||||
|
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:ip set") ,
|
||||||
|
qq( \$IPSET -N $set hash:ip family inet6) ,
|
||||||
|
qq( fi) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub load_ipsets() {
|
sub load_ipsets() {
|
||||||
|
|
||||||
my @ipsets = all_ipsets;
|
my @ipsets = all_ipsets;
|
||||||
|
Loading…
Reference in New Issue
Block a user