On 01/11/2013 01:50 PM, Tom Eastep wrote: > On 01/11/2013 01:03 PM, Steven Jan Springl wrote: > >> In the attached config. host file entry: >> >> lan eth0:!0.0.0.0/0 - >> >> generates the following iptables rule: >> >> -A PREROUTING -i eth0 -j ~excl0 >> >> which produces the following error message: >> >> iptables-restore v1.4.17: Couldn't load target `~excl0':No such file or >> directory > > The attached patch seems to eliminate the problem. I'm rather surprised > that you haven't run into this one before; there were similar cases is > three of your large configurations that I have in my regression suite. >
Here's a better patch; that one has a serious defect. -Tom -- Tom Eastep \ When I die, I want to go like my Grandfather who Shoreline, \ died peacefully in his sleep. Not screaming like Washington, USA \ all of the passengers in his car http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm
index f16b53f..d4b11a9 100644
--- a/Shorewall/Perl/Shorewall/Chains.pm
+++ b/Shorewall/Perl/Shorewall/Chains.pm
@@ -1419,9 +1419,18 @@ sub delete_chain_and_references( $ ) {
# We're going to delete this chain but first, we must delete all references to it.
#
my $tableref = $chain_table{$chainref->{table}};
- my $name1 = $chainref->{name};
+ my $name = $chainref->{name};
+
+ while ( my ( $chain, $references ) = each %{$chainref->{references}} ) {
+ my $chain1ref = $tableref->{$chain};
+ my @newrules = grep ( ( $_->{target} || '' ) ne $name, @{$chain1ref->{rules}} );
+ $chain1ref->{rules} = \@newrules;
+ }
+ #
+ # Now decrement the reference count of all targets of this chain's rules
+ #
for ( @{$chainref->{rules}} ) {
- decrement_reference_count( $tableref->{$_->{target}}, $name1 ) if $_->{target};
+ decrement_reference_count( $tableref->{$_->{target}}, $name ) if $_->{target};
}
delete_chain $chainref;
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
