aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2023-08-04 14:46:15 +0000
committerDavid S. Miller <[email protected]>2023-08-06 07:24:55 +0000
commita81722ddd7e4d76c9bbff078d29416e18c6d7f71 (patch)
tree83bf415b9788593c662c6fb41522bfaddbdf8ac9 /net/ipv4/tcp_timer.c
parenttcp: set TCP_KEEPCNT locklessly (diff)
downloadkernel-a81722ddd7e4d76c9bbff078d29416e18c6d7f71.tar.gz
kernel-a81722ddd7e4d76c9bbff078d29416e18c6d7f71.zip
tcp: set TCP_LINGER2 locklessly
tp->linger2 can be set locklessly as long as readers use READ_ONCE(). Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index f99e2d06ae7c..d45c96c7f5a4 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -714,7 +714,7 @@ static void tcp_keepalive_timer (struct timer_list *t)
tcp_mstamp_refresh(tp);
if (sk->sk_state == TCP_FIN_WAIT2 && sock_flag(sk, SOCK_DEAD)) {
- if (tp->linger2 >= 0) {
+ if (READ_ONCE(tp->linger2) >= 0) {
const int tmo = tcp_fin_time(sk) - TCP_TIMEWAIT_LEN;
if (tmo > 0) {