diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index ae3efcf4f..5d45a90c8 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1507,7 +1507,7 @@ sub qt1( $ ) { } # -# Delete the test chains +# Delete the test chains and IP sets # sub cleanup_iptables() { qt1( "$iptables $iptablesw -F $sillyname" ); @@ -1530,6 +1530,12 @@ sub cleanup_iptables() { qt1( "$iptables $iptablesw -t raw -X $sillyname" ); } + my $ipset = $config{IPSET} || 'ipset'; + $ipset = which( $ipset ) unless $ipset =~ '/'; + if ( $ipset && -x $ipset ) { + qt( "$ipset -X $sillyname" ); + } + $sillyname = $sillyname1 = ''; } @@ -1574,7 +1580,7 @@ sub cleanup() { unlink ( $perlscriptname ), $perlscriptname = undef if $perlscriptname; unlink ( @tempfiles ), @tempfiles = () if @tempfiles; # - # Delete temporary chains + # Delete temporary chains and IP sets # cleanup_iptables if $sillyname; }