diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index cf7f2086e6e0..df18ce04f41e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -204,7 +204,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
204 | * when trying new connection. | 204 | * when trying new connection. |
205 | */ | 205 | */ |
206 | if (peer != NULL && | 206 | if (peer != NULL && |
207 | peer->tcp_ts_stamp + TCP_PAWS_MSL >= get_seconds()) { | 207 | (u32)get_seconds() - peer->tcp_ts_stamp <= TCP_PAWS_MSL) { |
208 | tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp; | 208 | tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp; |
209 | tp->rx_opt.ts_recent = peer->tcp_ts; | 209 | tp->rx_opt.ts_recent = peer->tcp_ts; |
210 | } | 210 | } |
@@ -1308,7 +1308,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1308 | tcp_death_row.sysctl_tw_recycle && | 1308 | tcp_death_row.sysctl_tw_recycle && |
1309 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && | 1309 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && |
1310 | peer->v4daddr == saddr) { | 1310 | peer->v4daddr == saddr) { |
1311 | if (get_seconds() < peer->tcp_ts_stamp + TCP_PAWS_MSL && | 1311 | if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL && |
1312 | (s32)(peer->tcp_ts - req->ts_recent) > | 1312 | (s32)(peer->tcp_ts - req->ts_recent) > |
1313 | TCP_PAWS_WINDOW) { | 1313 | TCP_PAWS_WINDOW) { |
1314 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED); | 1314 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED); |
@@ -1727,9 +1727,9 @@ int tcp_v4_remember_stamp(struct sock *sk) | |||
1727 | 1727 | ||
1728 | if (peer) { | 1728 | if (peer) { |
1729 | if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 || | 1729 | if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 || |
1730 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() && | 1730 | ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL && |
1731 | peer->tcp_ts_stamp <= tp->rx_opt.ts_recent_stamp)) { | 1731 | peer->tcp_ts_stamp <= (u32)tp->rx_opt.ts_recent_stamp)) { |
1732 | peer->tcp_ts_stamp = tp->rx_opt.ts_recent_stamp; | 1732 | peer->tcp_ts_stamp = (u32)tp->rx_opt.ts_recent_stamp; |
1733 | peer->tcp_ts = tp->rx_opt.ts_recent; | 1733 | peer->tcp_ts = tp->rx_opt.ts_recent; |
1734 | } | 1734 | } |
1735 | if (release_it) | 1735 | if (release_it) |
@@ -1748,9 +1748,9 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw) | |||
1748 | const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); | 1748 | const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); |
1749 | 1749 | ||
1750 | if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 || | 1750 | if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 || |
1751 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() && | 1751 | ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL && |
1752 | peer->tcp_ts_stamp <= tcptw->tw_ts_recent_stamp)) { | 1752 | peer->tcp_ts_stamp <= (u32)tcptw->tw_ts_recent_stamp)) { |
1753 | peer->tcp_ts_stamp = tcptw->tw_ts_recent_stamp; | 1753 | peer->tcp_ts_stamp = (u32)tcptw->tw_ts_recent_stamp; |
1754 | peer->tcp_ts = tcptw->tw_ts_recent; | 1754 | peer->tcp_ts = tcptw->tw_ts_recent; |
1755 | } | 1755 | } |
1756 | inet_putpeer(peer); | 1756 | inet_putpeer(peer); |