Commit 5e032e32 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[IPV6] NDISC: Take source address into account for redirects.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarVille Nuorvala <vnuorval@tcs.hut.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a57d27fc
...@@ -110,6 +110,7 @@ extern int rt6_route_rcv(struct net_device *dev, ...@@ -110,6 +110,7 @@ extern int rt6_route_rcv(struct net_device *dev,
struct in6_addr *gwaddr); struct in6_addr *gwaddr);
extern void rt6_redirect(struct in6_addr *dest, extern void rt6_redirect(struct in6_addr *dest,
struct in6_addr *src,
struct in6_addr *saddr, struct in6_addr *saddr,
struct neighbour *neigh, struct neighbour *neigh,
u8 *lladdr, u8 *lladdr,
......
...@@ -1346,7 +1346,8 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) ...@@ -1346,7 +1346,8 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
neigh = __neigh_lookup(&nd_tbl, target, skb->dev, 1); neigh = __neigh_lookup(&nd_tbl, target, skb->dev, 1);
if (neigh) { 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); on_link);
neigh_release(neigh); neigh_release(neigh);
} }
......
...@@ -1279,7 +1279,8 @@ static int ip6_route_del(struct fib6_config *cfg) ...@@ -1279,7 +1279,8 @@ static int ip6_route_del(struct fib6_config *cfg)
/* /*
* Handle redirects * 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 neighbour *neigh, u8 *lladdr, int on_link)
{ {
struct rt6_info *rt, *nrt = NULL; struct rt6_info *rt, *nrt = NULL;
...@@ -1304,7 +1305,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr, ...@@ -1304,7 +1305,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
*/ */
read_lock_bh(&table->tb6_lock); read_lock_bh(&table->tb6_lock);
fn = fib6_lookup(&table->tb6_root, dest, NULL); fn = fib6_lookup(&table->tb6_root, dest, src);
restart: restart:
for (rt = fn->leaf; rt; rt = rt->u.next) { for (rt = fn->leaf; rt; rt = rt->u.next) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment