diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-12-04 13:12:43 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-12-04 13:12:43 +0100 |
commit | e4a7da4a76137dab99b98ce126ec2837dd53f638 (patch) | |
tree | 5e76b7f32c6e8fd0cf7f82084fd65e74d0e1979d /net | |
parent | f1f7d270d4a610222efe9920b8443d807355bfca (diff) |
[EBTABLES]: Deal with the worst-case behaviour in loop checks.
No need to revisit a chain we'd already finished with during
the check for current hook. It's either instant loop (which
we'd just detected) or a duplicate work.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 609d52065f4..12a57ae1cea 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -738,7 +738,9 @@ static int check_chainloops(struct ebt_entries *chain, struct ebt_cl_stack *cl_s BUGPRINT("loop\n"); return -1; } - /* this can't be 0, so the above test is correct */ + if (cl_s[i].hookmask & (1 << hooknr)) + goto letscontinue; + /* this can't be 0, so the loop test is correct */ cl_s[i].cs.n = pos + 1; pos = 0; cl_s[i].cs.e = ((void *)e + e->next_offset); |