aboutsummaryrefslogtreecommitdiff
path: root/include/linux/bpf-cgroup.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-10-10 17:48:13 +0000
committerJakub Kicinski <kuba@kernel.org>2024-10-14 17:39:36 -0700
commit78e2baf3d96edd21c6f26d8afc0e68d02ec2c51c (patch)
tree1e2bc7edfdc0b93abf08ad7955c5deff577e08ec /include/linux/bpf-cgroup.h
parent76d37e4fd638a582cf13bec243ebab0af3658d07 (diff)
downloadlinux-78e2baf3d96edd21c6f26d8afc0e68d02ec2c51c.tar.gz
linux-78e2baf3d96edd21c6f26d8afc0e68d02ec2c51c.tar.bz2
linux-78e2baf3d96edd21c6f26d8afc0e68d02ec2c51c.zip
net: add TIME_WAIT logic to sk_to_full_sk()
TCP will soon attach TIME_WAIT sockets to some ACK and RST. Make sure sk_to_full_sk() detects this and does not return a non full socket. v3: also changed sk_const_to_full_sk() Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org> Reviewed-by: Brian Vazquez <brianvv@google.com> Link: https://patch.msgid.link/20241010174817.1543642-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/bpf-cgroup.h')
-rw-r--r--include/linux/bpf-cgroup.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index ce91d9b2acb9..f0f219271daf 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -209,7 +209,7 @@ static inline bool cgroup_bpf_sock_enabled(struct sock *sk,
int __ret = 0; \
if (cgroup_bpf_enabled(CGROUP_INET_EGRESS) && sk) { \
typeof(sk) __sk = sk_to_full_sk(sk); \
- if (sk_fullsock(__sk) && __sk == skb_to_full_sk(skb) && \
+ if (__sk && __sk == skb_to_full_sk(skb) && \
cgroup_bpf_sock_enabled(__sk, CGROUP_INET_EGRESS)) \
__ret = __cgroup_bpf_run_filter_skb(__sk, skb, \
CGROUP_INET_EGRESS); \