summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:48 +0000
committerDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:48 +0000
commitdf28e8690e7126fa5c99e8863c27574204589f31 (patch)
treefd943e26281cfd7a7e0948d1949d6e0009c19510 /net/ipv4/tcp_output.c
parent39a86d059a78bf29b66dd8bbeab04af1d55c02ba (diff)
parente9d9da91548b21e189fcd0259a0f2d26d1afc509 (diff)
Merge branch 'net-better-const'
Eric Dumazet says: ==================== net: better const qualifier awareness This is a follow-up of d27d367d3b78 ("inet: better const qualifier awareness") Adopting container_of_const() to perform (struct sock *)->(protocol sock *) operation is allowing us to propagate const qualifier and thus detect misuses at compile time. Most conversions are trivial, because most protocols did not adopt yet const sk pointers where it could make sense. Only mptcp and tcp patches (end of this series) are requiring small adjustments. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b1e743b39a83..cfe128b81a01 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -4127,8 +4127,13 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
if (!res) {
TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS);
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
- if (unlikely(tcp_passive_fastopen(sk)))
- tcp_sk(sk)->total_retrans++;
+ if (unlikely(tcp_passive_fastopen(sk))) {
+ /* sk has const attribute because listeners are lockless.
+ * However in this case, we are dealing with a passive fastopen
+ * socket thus we can change total_retrans value.
+ */
+ tcp_sk_rw(sk)->total_retrans++;
+ }
trace_tcp_retransmit_synack(sk, req);
}
return res;