All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Samuel Jean" <jix@bugmachine.ca>
To: <laforge@netfilter.org>
Cc: netfilter-devel@lists.netfilter.org, kaber@trash.net
Subject: [PATCH] IMPORTANT: trivial fix for bug introduced by hlist change
Date: Sun, 27 Mar 2005 00:52:22 -0000	[thread overview]
Message-ID: <twig.1111884742.85179@bugmachine.ca> (raw)

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

Hi Harald,

I've introduced a really annoying bug with the hlist change.. *sigh*
__dsthash_find() will return junk as soon as there's something in the bucket.

Patch's attached.

Sorry for the inconveniant, please apply ASAP.


[-- Attachment #2: hashlimit-corrupt.patch --]
[-- Type: application/octet-stream, Size: 736 bytes --]

--- a/net/ipv4/netfilter/ipt_hashlimit.c	2005-03-26 19:33:06.000000000 -0500
+++ b/net/ipv4/netfilter/ipt_hashlimit.c	2005-03-26 19:38:26.000000000 -0500
@@ -116,18 +116,18 @@ hash_dst(const struct ipt_hashlimit_htab
 static inline struct dsthash_ent *
 __dsthash_find(const struct ipt_hashlimit_htable *ht, struct dsthash_dst *dst)
 {
-	struct dsthash_ent *ent = NULL;
+	struct dsthash_ent *ent;
 	struct hlist_node *pos;
 	u_int32_t hash = hash_dst(ht, dst);
 
 	if (!hlist_empty(&ht->hash[hash]))
 		hlist_for_each_entry(ent, pos, &ht->hash[hash], node) {
 			if (dst_cmp(ent, dst)) {
-				break;
+				return ent;
 			}
 		}
 	
-	return ent;
+	return NULL;
 }
 
 /* allocate dsthash_ent, initialize dst, put in htable and lock it */

                 reply	other threads:[~2005-03-27  0:52 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=twig.1111884742.85179@bugmachine.ca \
    --to=jix@bugmachine.ca \
    --cc=kaber@trash.net \
    --cc=laforge@netfilter.org \
    --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.