[IPV6] NDISC: Take source address into account for redirects.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Thu, 24 Aug 2006 00:12:24 +0000 (17:12 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 21:55:41 +0000 (14:55 -0700)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip6_route.h
net/ipv6/ndisc.c
net/ipv6/route.c

index 3f170f667c7b81cd7b84ad2ba92e8c99104be6ea..249ce4545ef0b6d44513458515c26e9e3290957d 100644 (file)
@@ -110,6 +110,7 @@ extern int                  rt6_route_rcv(struct net_device *dev,
                                              struct in6_addr *gwaddr);
 
 extern void                    rt6_redirect(struct in6_addr *dest,
+                                            struct in6_addr *src,
                                             struct in6_addr *saddr,
                                             struct neighbour *neigh,
                                             u8 *lladdr,
index 419d65163819e573c39a4a9d792837587bb7ed62..32f28dec399e15854723e5c800e86caeeb4138b1 100644 (file)
@@ -1346,7 +1346,8 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
 
        neigh = __neigh_lookup(&nd_tbl, target, skb->dev, 1);
        if (neigh) {
-               rt6_redirect(dest, &skb->nh.ipv6h->saddr, neigh, lladdr, 
+               rt6_redirect(dest, &skb->nh.ipv6h->daddr,
+                            &skb->nh.ipv6h->saddr, neigh, lladdr,
                             on_link);
                neigh_release(neigh);
        }
index 5d6e9083ca2cfbc659ceb2156b9674cf0f4e0d73..a9b08a2422e0f83ed49d3c14c9e4b7cd55d017f0 100644 (file)
@@ -1279,7 +1279,8 @@ static int ip6_route_del(struct fib6_config *cfg)
 /*
  *     Handle redirects
  */
-void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
+void rt6_redirect(struct in6_addr *dest, struct in6_addr *src,
+                 struct in6_addr *saddr,
                  struct neighbour *neigh, u8 *lladdr, int on_link)
 {
        struct rt6_info *rt, *nrt = NULL;
@@ -1304,7 +1305,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
         */
 
        read_lock_bh(&table->tb6_lock);
-       fn = fib6_lookup(&table->tb6_root, dest, NULL);
+       fn = fib6_lookup(&table->tb6_root, dest, src);
 restart:
        for (rt = fn->leaf; rt; rt = rt->u.next) {
                /*