aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-08-23 20:12:24 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:41 -0400
commit5e032e32ecc2e6cb0385dc115ca9bfe5e19a9539 (patch)
treea920b2450737c8688ed7fbbbc73b47a7402f04c6
parenta57d27fc7107ddcc655ba2812cfebfce3163fd62 (diff)
[IPV6] NDISC: Take source address into account for redirects.
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>
-rw-r--r--include/net/ip6_route.h1
-rw-r--r--net/ipv6/ndisc.c3
-rw-r--r--net/ipv6/route.c5
3 files changed, 6 insertions, 3 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 3f170f667c7b..249ce4545ef0 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -110,6 +110,7 @@ extern int rt6_route_rcv(struct net_device *dev,
110 struct in6_addr *gwaddr); 110 struct in6_addr *gwaddr);
111 111
112extern void rt6_redirect(struct in6_addr *dest, 112extern void rt6_redirect(struct in6_addr *dest,
113 struct in6_addr *src,
113 struct in6_addr *saddr, 114 struct in6_addr *saddr,
114 struct neighbour *neigh, 115 struct neighbour *neigh,
115 u8 *lladdr, 116 u8 *lladdr,
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 419d65163819..32f28dec399e 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1346,7 +1346,8 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
1346 1346
1347 neigh = __neigh_lookup(&nd_tbl, target, skb->dev, 1); 1347 neigh = __neigh_lookup(&nd_tbl, target, skb->dev, 1);
1348 if (neigh) { 1348 if (neigh) {
1349 rt6_redirect(dest, &skb->nh.ipv6h->saddr, neigh, lladdr, 1349 rt6_redirect(dest, &skb->nh.ipv6h->daddr,
1350 &skb->nh.ipv6h->saddr, neigh, lladdr,
1350 on_link); 1351 on_link);
1351 neigh_release(neigh); 1352 neigh_release(neigh);
1352 } 1353 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5d6e9083ca2c..a9b08a2422e0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1279,7 +1279,8 @@ static int ip6_route_del(struct fib6_config *cfg)
1279/* 1279/*
1280 * Handle redirects 1280 * Handle redirects
1281 */ 1281 */
1282void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr, 1282void rt6_redirect(struct in6_addr *dest, struct in6_addr *src,
1283 struct in6_addr *saddr,
1283 struct neighbour *neigh, u8 *lladdr, int on_link) 1284 struct neighbour *neigh, u8 *lladdr, int on_link)
1284{ 1285{
1285 struct rt6_info *rt, *nrt = NULL; 1286 struct rt6_info *rt, *nrt = NULL;
@@ -1304,7 +1305,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
1304 */ 1305 */
1305 1306
1306 read_lock_bh(&table->tb6_lock); 1307 read_lock_bh(&table->tb6_lock);
1307 fn = fib6_lookup(&table->tb6_root, dest, NULL); 1308 fn = fib6_lookup(&table->tb6_root, dest, src);
1308restart: 1309restart:
1309 for (rt = fn->leaf; rt; rt = rt->u.next) { 1310 for (rt = fn->leaf; rt; rt = rt->u.next) {
1310 /* 1311 /*