netdev
[Top] [All Lists]

Re: A bug in the Kernel?

To: itkes@xxxxxxxxxxxxxxx
Subject: Re: A bug in the Kernel?
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Sun, 27 Feb 2005 17:26:36 +0100
Cc: netdev@xxxxxxxxxxx
In-reply-to: <1125.80.249.146.137.1109520029.squirrel@mx.imec.msu.ru>
References: <1125.80.249.146.137.1109520029.squirrel@mx.imec.msu.ru>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1
itkes@xxxxxxxxxxxxxxx wrote:
Let us suppose the application to request the routing tabled dump. I heve
found that in some conditions, this application may not receive some
unchanged routes, if some other routes was deleted.

Could you describe this condition in more detail ? In your patch you change the type of "args" to void *, which results in a bigger patch and it shouldn't be done anyway. If you need to store a pointer simply cast it to long. Please send a plain (not gzipped) patch without this change and without the EXTRAVERSION change.

P.S. After I have finished the patch, I found another bug in the Routing
Tables Dump. In function fn_hash_dump_bucket in fib_hash.c there is a
construction:
if (i<s_i)
        continue;
...
i++;
If the first "if" is true in first moment, "i" will never be increased and
some routes will be lost. My patch fixes this bug, too.

Good catch, this bug was introduced when switching to hlist_for_each_entry().

-       for (i=0; f; i++, f=f->fn_next) {
-               if (i < s_i) continue;
+       i = 0;
+       hlist_for_each_entry(f, node, head, fn_hash) {
+               struct fib_alias *fa;
+
+               list_for_each_entry(fa, &f->fn_alias, fa_list) {
+                       if (i < s_i)
+                               continue;

Regards
Patrick

<Prev in Thread] Current Thread [Next in Thread>