Re: [TRIVIAL] Fix recent bug in fib_semantics.c

David S. Miller
2004-09-18T06:34:47Z

On Sat, 18 Sep 2004 14:16:28 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> Thanks. The following bug is probably your problem.

Good catch on this fix, but really he's hitting the
BUG_ON() in fib_sync_down() (I hate i386 backtraces,
it's an art to decode them properly)

So if you rmmod() a device before any routes are ever
created in ipv4, this triggers. I didn't think this
was possible, but it is.

The fix is simple enough.

===== net/ipv4/fib_semantics.c 1.16 vs edited =====
--- 1.16/net/ipv4/fib_semantics.c 2004-09-17 11:11:04 -07:00
+++ edited/net/ipv4/fib_semantics.c 2004-09-17 23:14:44 -07:00
@@ -1040,9 +1040,7 @@
if (force)
scope = -1;

- BUG_ON(!fib_info_laddrhash);
-
- if (local) {
+ if (local && fib_info_laddrhash) {
unsigned int hash = fib_laddr_hashfn(local);
struct hlist_head *head = &fib_info_laddrhash[hash];
struct hlist_node *node;