First, thanks to Alexey for explaining some basic misunderstandings I
had about the networking code - I had got myself quite confused. Being
able to discuss things with the developers makes a very refeshing
change from commercial Un*x.

This time my question is about ip_rt_redirect. I'm pretty sure that it
doesn't actually work. I believe that the structure of the code is roughly:

For all possible keys,
{
    Search through the route cache linked list for the matching key
    if the key exists,
    {
        Allocate memory for a new route entry        dst_alloc
        Copy the old route cache entry               *rt=*rth
        Fix the gateway value                        rt->rt_gateway = new_gw
        Check the gateway is responding to arp (?)   arp_bind_neighbour
        Delete the old route cache entry             rt_del
        Insert the new route cache entry             rt_intern_hash
    }
}

rt_intern_hash adds a new entry to the hash table provided that there
is no existing entry with a matching key. There usually won't be a
match because we have only just deleted the old route. Well, that's
what I think it meant to happen. We actually delete the new route so
packets continue to be sent to the old gateway. Here's a patch:

--- linux-2.3.18/net/ipv4/route.c.orig  Thu Oct  7 05:34:08 1999
+++ linux-2.3.18/net/ipv4/route.c       Thu Oct  7 05:34:49 1999
@@ -735,7 +735,7 @@
                                        goto do_next;
                                }
 
-                               rt_del(hash, rt);
+                               rt_del(hash, rth);
                                if (!rt_intern_hash(hash, rt, &rt))
                                        ip_rt_put(rt);
                                goto do_next;

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to