Subject: | Oddity in flush_entries |
If you have an existing chain with entries prior to running your perl script with IPTables::IPv4 and you call flush_entries, you get an error No such file or directory even though summarily calling a table->commit() will flush the chain.
I believe the problem is related to the table caching functionality.
A work around is simply to modify the DB tie to clear the chain:
This works:
%IPTables::IPv4 = ( filter => { $chain => { } } );
This should work but doesn't:
@rules = $table->list_rules($chain);
if ($#rules + 1 > 0) {
$rv = $table->flush_entries($chain);
if ($rv) {
print "Error Flushing $chain - $!\n";
$error++;
}
}
KAM