From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 2.6 1/12]: Don't try to do any random dropping
Date: Tue, 21 Sep 2004 05:20:34 +0200 [thread overview]
Message-ID: <414F9E02.8020703@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 263 bytes --]
ChangeSet@1.1935.1.1, 2004-09-18 23:18:23+02:00, rusty@rustcorp.com.au
[NETFILTER]: Don't try to do any random dropping since we now use
jenkins hash
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 1824 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/18 23:18:23+02:00 rusty@rustcorp.com.au
# [NETFILTER]: Don't try to do any random dropping since we now use jenkins hash
#
# Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv4/netfilter/ip_conntrack_core.c
# 2004/09/18 23:17:57+02:00 rusty@rustcorp.com.au +4 -10
# [NETFILTER]: Don't try to do any random dropping since we now use jenkins hash
#
# Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
--- a/net/ipv4/netfilter/ip_conntrack_core.c 2004-09-20 11:56:46 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_core.c 2004-09-20 11:56:46 +02:00
@@ -571,7 +571,6 @@
size_t hash;
struct ip_conntrack_expect *expected;
int i;
- static unsigned int drop_next;
if (!ip_conntrack_hash_rnd_initted) {
get_random_bytes(&ip_conntrack_hash_rnd, 4);
@@ -580,15 +579,10 @@
hash = hash_conntrack(tuple);
- if (ip_conntrack_max &&
- atomic_read(&ip_conntrack_count) >= ip_conntrack_max) {
- /* Try dropping from random chain, or else from the
- chain about to put into (in case they're trying to
- bomb one hash chain). */
- unsigned int next = (drop_next++)%ip_conntrack_htable_size;
-
- if (!early_drop(&ip_conntrack_hash[next])
- && !early_drop(&ip_conntrack_hash[hash])) {
+ if (ip_conntrack_max
+ && atomic_read(&ip_conntrack_count) >= ip_conntrack_max) {
+ /* Try dropping from this hash chain. */
+ if (!early_drop(&ip_conntrack_hash[hash])) {
if (net_ratelimit())
printk(KERN_WARNING
"ip_conntrack: table full, dropping"
reply other threads:[~2004-09-21 3:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=414F9E02.8020703@trash.net \
--to=kaber@trash.net \
--cc=davem@redhat.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.