|
From: Suzor, G. <sys...@ap...> - 2003-08-12 18:12:47
|
Hello,
I started off using IPTables::IPv4 0.97b from CPAN. Everything was fine
until I noticed a memory leak. Long story short, the latest version from
cvs, which I'll call "0.98", fixed the problem. However, a new problem has
emerged.
Assuming that 'custom_mangle_chain' and 'custom_filter_chain' already exist
with some rules, the following code will work with 0.97b, but fail with
"0.98":
---------------------------------------------
#!/usr/bin/perl
use strict;
use IPTables::IPv4;
my $mangle = IPTables::IPv4::init('mangle');
my $filter = IPTables::IPv4::init('filter');
$mangle->delete_num_entry('custom_mangle_chain', 3);
$filter->delete_num_entry('custom_filter_chain', 7);
$mangle->commit();
$filter->commit();
---------------------------------------------
With 0.97b, both rules are properly deleted. However, with "0.98", only
"mangle->custom_mangle_chain->rule_3" is deleted. If the last two lines
above are switched, then only "filter->custom_filter_chain->rule_7" is
deleted. I'm guessing that the problem has something to do with the new
commit() and DESTROY semantics as described in the README for "0.98".
The code that I'm writing is in an infinite loop (it does sleep for some
time), so the memory leak from 0.97b will add up after time. So I'd like to
use "0.98" if commit() could be "fixed" for it. Any help with this would be
appreciated.
Thanks,
Greg Suzor
|