Commit ed2361e6 authored by David S. Miller's avatar David S. Miller

ipv4: Pass explicit destination address to rt_get_peer().

This will next trickle down to rt_bind_peer().
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bd023f3
...@@ -292,7 +292,7 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable ...@@ -292,7 +292,7 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
extern void rt_bind_peer(struct rtable *rt, int create); extern void rt_bind_peer(struct rtable *rt, int create);
static inline struct inet_peer *rt_get_peer(struct rtable *rt) static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr)
{ {
if (rt->peer) if (rt->peer)
return rt->peer; return rt->peer;
......
...@@ -206,7 +206,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -206,7 +206,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
if (tcp_death_row.sysctl_tw_recycle && if (tcp_death_row.sysctl_tw_recycle &&
!tp->rx_opt.ts_recent_stamp && fl4->daddr == daddr) { !tp->rx_opt.ts_recent_stamp && fl4->daddr == daddr) {
struct inet_peer *peer = rt_get_peer(rt); struct inet_peer *peer = rt_get_peer(rt, fl4->daddr);
/* /*
* VJ's idea. We save last timestamp seen from * VJ's idea. We save last timestamp seen from
* the destination in peer table, when entering state * the destination in peer table, when entering state
...@@ -1353,8 +1353,8 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1353,8 +1353,8 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (tmp_opt.saw_tstamp && if (tmp_opt.saw_tstamp &&
tcp_death_row.sysctl_tw_recycle && tcp_death_row.sysctl_tw_recycle &&
(dst = inet_csk_route_req(sk, &fl4, req)) != NULL && (dst = inet_csk_route_req(sk, &fl4, req)) != NULL &&
(peer = rt_get_peer((struct rtable *)dst)) != NULL && fl4.daddr == saddr &&
peer->daddr.addr.a4 == saddr) { (peer = rt_get_peer((struct rtable *)dst, fl4.daddr)) != NULL) {
inet_peer_refcheck(peer); inet_peer_refcheck(peer);
if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL && if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL &&
(s32)(peer->tcp_ts - req->ts_recent) > (s32)(peer->tcp_ts - req->ts_recent) >
......
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