|
@@ -204,7 +204,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
|
|
* when trying new connection.
|
|
* when trying new connection.
|
|
*/
|
|
*/
|
|
if (peer != NULL &&
|
|
if (peer != NULL &&
|
|
- peer->tcp_ts_stamp + TCP_PAWS_MSL >= get_seconds()) {
|
|
|
|
|
|
+ (u32)get_seconds() - peer->tcp_ts_stamp <= TCP_PAWS_MSL) {
|
|
tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp;
|
|
tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp;
|
|
tp->rx_opt.ts_recent = peer->tcp_ts;
|
|
tp->rx_opt.ts_recent = peer->tcp_ts;
|
|
}
|
|
}
|
|
@@ -1308,7 +1308,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|
tcp_death_row.sysctl_tw_recycle &&
|
|
tcp_death_row.sysctl_tw_recycle &&
|
|
(peer = rt_get_peer((struct rtable *)dst)) != NULL &&
|
|
(peer = rt_get_peer((struct rtable *)dst)) != NULL &&
|
|
peer->v4daddr == saddr) {
|
|
peer->v4daddr == saddr) {
|
|
- if (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) >
|
|
TCP_PAWS_WINDOW) {
|
|
TCP_PAWS_WINDOW) {
|
|
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED);
|
|
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED);
|
|
@@ -1727,9 +1727,9 @@ int tcp_v4_remember_stamp(struct sock *sk)
|
|
|
|
|
|
if (peer) {
|
|
if (peer) {
|
|
if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 ||
|
|
if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 ||
|
|
- (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() &&
|
|
|
|
- peer->tcp_ts_stamp <= tp->rx_opt.ts_recent_stamp)) {
|
|
|
|
- peer->tcp_ts_stamp = tp->rx_opt.ts_recent_stamp;
|
|
|
|
|
|
+ ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL &&
|
|
|
|
+ peer->tcp_ts_stamp <= (u32)tp->rx_opt.ts_recent_stamp)) {
|
|
|
|
+ peer->tcp_ts_stamp = (u32)tp->rx_opt.ts_recent_stamp;
|
|
peer->tcp_ts = tp->rx_opt.ts_recent;
|
|
peer->tcp_ts = tp->rx_opt.ts_recent;
|
|
}
|
|
}
|
|
if (release_it)
|
|
if (release_it)
|
|
@@ -1748,9 +1748,9 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw)
|
|
const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
|
|
const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
|
|
|
|
|
|
if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 ||
|
|
if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 ||
|
|
- (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() &&
|
|
|
|
- peer->tcp_ts_stamp <= tcptw->tw_ts_recent_stamp)) {
|
|
|
|
- peer->tcp_ts_stamp = tcptw->tw_ts_recent_stamp;
|
|
|
|
|
|
+ ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL &&
|
|
|
|
+ peer->tcp_ts_stamp <= (u32)tcptw->tw_ts_recent_stamp)) {
|
|
|
|
+ peer->tcp_ts_stamp = (u32)tcptw->tw_ts_recent_stamp;
|
|
peer->tcp_ts = tcptw->tw_ts_recent;
|
|
peer->tcp_ts = tcptw->tw_ts_recent;
|
|
}
|
|
}
|
|
inet_putpeer(peer);
|
|
inet_putpeer(peer);
|