summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/tcp.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a720a2a7cb1c..b6e69e6c81fd 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -490,9 +490,9 @@ static inline void tcp_synq_overflow(const struct sock *sk)
}
}
- last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
+ last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
if (!time_between32(now, last_overflow, last_overflow + HZ))
- tcp_sk(sk)->rx_opt.ts_recent_stamp = now;
+ WRITE_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp, now);
}
/* syncookies: no recent synqueue overflow on this listening socket? */
@@ -513,7 +513,7 @@ static inline bool tcp_synq_no_recent_overflow(const struct sock *sk)
}
}
- last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
+ last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
/* If last_overflow <= jiffies <= last_overflow + TCP_SYNCOOKIE_VALID,
* then we're under synflood. However, we have to use