summaryrefslogtreecommitdiff
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-18 18:42:43 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-18 18:42:43 -0400
commita48eff128865aa20520fa6e0e0c5fbd2ac50d712 (patch)
treec60e376c3fca23bb215c977e42661187076dccbf /net/ipv4/route.c
parented2361e66eec60645f8e4715fe39a42235ef43ae (diff)
ipv4: Pass explicit destination address to rt_bind_peer().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9c5ad86bc783..b24d58e6bbcd 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -156,7 +156,7 @@ static u32 *ipv4_cow_metrics(struct dst_entry *dst, unsigned long old)
u32 *p = NULL;
if (!rt->peer)
- rt_bind_peer(rt, 1);
+ rt_bind_peer(rt, rt->rt_dst, 1);
peer = rt->peer;
if (peer) {
@@ -1193,11 +1193,11 @@ static u32 rt_peer_genid(void)
return atomic_read(&__rt_peer_genid);
}
-void rt_bind_peer(struct rtable *rt, int create)
+void rt_bind_peer(struct rtable *rt, __be32 daddr, int create)
{
struct inet_peer *peer;
- peer = inet_getpeer_v4(rt->rt_dst, create);
+ peer = inet_getpeer_v4(daddr, create);
if (peer && cmpxchg(&rt->peer, NULL, peer) != NULL)
inet_putpeer(peer);
@@ -1231,7 +1231,7 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more)
if (rt) {
if (rt->peer == NULL)
- rt_bind_peer(rt, 1);
+ rt_bind_peer(rt, rt->rt_dst, 1);
/* If peer is attached to destination, it is never detached,
so that we need not to grab a lock to dereference it.
@@ -1377,7 +1377,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)
rcu_read_unlock();
if (!rt->peer)
- rt_bind_peer(rt, 1);
+ rt_bind_peer(rt, rt->rt_dst, 1);
peer = rt->peer;
if (!peer) {
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt->rt_gateway);
@@ -1445,7 +1445,7 @@ static int ip_error(struct sk_buff *skb)
}
if (!rt->peer)
- rt_bind_peer(rt, 1);
+ rt_bind_peer(rt, rt->rt_dst, 1);
peer = rt->peer;
send = true;
@@ -1552,7 +1552,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
dst_confirm(dst);
if (!rt->peer)
- rt_bind_peer(rt, 1);
+ rt_bind_peer(rt, rt->rt_dst, 1);
peer = rt->peer;
if (peer) {
if (mtu < ip_rt_min_pmtu)
@@ -1609,7 +1609,7 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)
struct inet_peer *peer;
if (!rt->peer)
- rt_bind_peer(rt, 0);
+ rt_bind_peer(rt, rt->rt_dst, 0);
peer = rt->peer;
if (peer && peer->pmtu_expires)