Re: 2.6.9-rc2-mm2 fn_hash_insert oops

From: Herbert Xu
Date: Thu Sep 23 2004 - 06:18:51 EST


Lukas Hejtmanek <xhejtman@xxxxxxxxxxxx> wrote:
>
> However there is still the issue with endless loop in fn_hash_delete :(

Same problem, same fix. Can someone think of a generic fix to
list_for_each_*?

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
===== net/ipv4/fib_hash.c 1.22 vs edited =====
--- 1.22/net/ipv4/fib_hash.c 2004-09-22 09:31:48 +10:00
+++ edited/net/ipv4/fib_hash.c 2004-09-23 21:16:04 +10:00
@@ -608,6 +608,7 @@
struct fn_hash *table = (struct fn_hash*)tb->tb_data;
struct fib_node *f;
struct fib_alias *fa, *fa_to_delete;
+ struct list_head *fa_head;
int z = r->rtm_dst_len;
struct fn_zone *fz;
u32 key;
@@ -633,7 +634,8 @@
return -ESRCH;

fa_to_delete = NULL;
- list_for_each_entry(fa, fa->fa_list.prev, fa_list) {
+ fa_head = fa->fa_list.prev;
+ list_for_each_entry(fa, fa_head, fa_list) {
struct fib_info *fi = fa->fa_info;

if ((!r->rtm_type ||
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/