aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-03-25 14:26:35 -0400
committerPatrick McHardy <kaber@trash.net>2009-03-25 14:26:35 -0400
commit1f9352ae2253a97b07b34dcf16ffa3b4ca12c558 (patch)
treee6d487c5d0dd82da34b53cc64bfd7c2d5e9f98f1 /net/ipv6
parentaf9d32ad6718b9a80fa89f557cc1fbb63a93ec15 (diff)
netfilter: {ip,ip6,arp}_tables: fix incorrect loop detection
Commit e1b4b9f ([NETFILTER]: {ip,ip6,arp}_tables: fix exponential worst-case search for loops) introduced a regression in the loop detection algorithm, causing sporadic incorrectly detected loops. When a chain has already been visited during the check, it is treated as having a standard target containing a RETURN verdict directly at the beginning in order to not check it again. The real target of the first rule is then incorrectly treated as STANDARD target and checked not to contain invalid verdicts. Fix by making sure the rule does actually contain a standard target. Based on patch by Francis Dupont <Francis_Dupont@isc.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/ip6_tables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index e59662b3b5b9..e89cfa3a8f25 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -517,7 +517,9 @@ mark_source_chains(struct xt_table_info *newinfo,
517 && unconditional(&e->ipv6)) || visited) { 517 && unconditional(&e->ipv6)) || visited) {
518 unsigned int oldpos, size; 518 unsigned int oldpos, size;
519 519
520 if (t->verdict < -NF_MAX_VERDICT - 1) { 520 if ((strcmp(t->target.u.user.name,
521 IP6T_STANDARD_TARGET) == 0) &&
522 t->verdict < -NF_MAX_VERDICT - 1) {
521 duprintf("mark_source_chains: bad " 523 duprintf("mark_source_chains: bad "
522 "negative verdict (%i)\n", 524 "negative verdict (%i)\n",
523 t->verdict); 525 t->verdict);