public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 791c2b45d873d02d3955ac846b69a3ee1e1f6f47
@ 2014-10-04 11:53 git
  0 siblings, 0 replies; only message in thread
From: git @ 2014-10-04 11:53 UTC (permalink / raw)
  To: ipfire-scm

[-- Attachment #1: Type: text/plain, Size: 2173 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  791c2b45d873d02d3955ac846b69a3ee1e1f6f47 (commit)
      from  243f8ca6e937084c18085d85278ee9c200c69936 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 791c2b45d873d02d3955ac846b69a3ee1e1f6f47
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Sat Oct 4 13:52:15 2014 +0200

    firewall: fix rules.pl for old rules without ratelimiting.

-----------------------------------------------------------------------

Summary of changes:
 config/firewall/rules.pl | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Difference in files:
diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl
index 40fb8dd..4d70382 100755
--- a/config/firewall/rules.pl
+++ b/config/firewall/rules.pl
@@ -131,6 +131,12 @@ sub print_rule {
 	print "\n";
 }
 
+sub count_elements {
+	my $hash = shift;
+
+	return scalar @$hash;
+}
+
 sub flush {
 	run("$IPTABLES -F $CHAIN_INPUT");
 	run("$IPTABLES -F $CHAIN_FORWARD");
@@ -186,6 +192,9 @@ sub buildrules {
 		# Skip disabled rules.
 		next unless ($$hash{$key}[2] eq 'ON');
 
+		# Count number of elements in this line
+		my $elements = &count_elements($$hash{$key});
+
 		if ($DEBUG) {
 			print_rule($$hash{$key});
 		}
@@ -270,7 +279,8 @@ sub buildrules {
 
 		# Concurrent connection limit
 		my @ratelimit_options = ();
-		if ($$hash{$key}[32] eq 'ON') {
+
+		if (($elements gt 34) && ($$hash{$key}[32] eq 'ON')) {
 			my $conn_limit = $$hash{$key}[33];
 
 			if ($conn_limit ge 1) {
@@ -286,7 +296,7 @@ sub buildrules {
 		}
 
 		# Ratelimit
-		if ($$hash{$key}[34] eq 'ON') {
+		if (($elements gt 37) && ($$hash{$key}[34] eq 'ON')) {
 			my $rate_limit = "$$hash{$key}[35]/$$hash{$key}[36]";
 
 				if ($rate_limit) {


hooks/post-receive
--
IPFire 2.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-04 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-04 11:53 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 791c2b45d873d02d3955ac846b69a3ee1e1f6f47 git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox