summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-03-17 15:55:39 +0000
committerDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:34 +0000
commite9d9da91548b21e189fcd0259a0f2d26d1afc509 (patch)
treefd943e26281cfd7a7e0948d1949d6e0009c19510 /net/ipv4/tcp.c
parent403a40f2304d4730a780ab9d6a2b93d1e4ac39d2 (diff)
downloadlinux-stable-e9d9da91548b21e189fcd0259a0f2d26d1afc509.tar.gz
linux-stable-e9d9da91548b21e189fcd0259a0f2d26d1afc509.tar.bz2
linux-stable-e9d9da91548b21e189fcd0259a0f2d26d1afc509.zip
tcp: preserve const qualifier in tcp_sk()
We can change tcp_sk() to propagate its argument const qualifier, thanks to container_of_const(). We have two places where a const sock pointer has to be upgraded to a write one. We have been using const qualifier for lockless listeners to clearly identify points where writes could happen. Add tcp_sk_rw() helper to better document these. tcp_inbound_md5_hash(), __tcp_grow_window(), tcp_reset_check() and tcp_rack_reo_wnd() get an additional const qualififer for their @tp local variables. smc_check_reset_syn_req() also needs a similar change. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 01569de651b6..fd68d49490f2 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4570,7 +4570,7 @@ tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
const __u8 *hash_location = NULL;
struct tcp_md5sig_key *hash_expected;
const struct tcphdr *th = tcp_hdr(skb);
- struct tcp_sock *tp = tcp_sk(sk);
+ const struct tcp_sock *tp = tcp_sk(sk);
int genhash, l3index;
u8 newhash[16];