Skip Menu |

This queue is for tickets about the IPTables-IPv4 CPAN distribution.

Report information
The Basics
Id: 7347
Status: resolved
Priority: 0/
Queue: IPTables-IPv4

People
Owner: Nobody in particular
Requestors: kmcgrail [...] pccc.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.98
Fixed in: (no value)



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
Sorry, I got stung on the table->commit() twice bug and I was reversing the $rv. Not sure why $! was populated but I think it's not an error. I should have been testing if (!$rv). Sorry again.