From 6aa2961381866a7857915f73a23026884107a7a6 Mon Sep 17 00:00:00 2001 From: zhangmingyi Date: Tue, 21 Jan 2025 16:05:47 +0800 Subject: [PATCH] ipv4, bpf: Introduced to support the ULP to modify sockets during setopt Note that tcp_getsockopt and tcp_setsockopt support TCP_ULP, while bpf_getsockopt and bpf_setsockopt do not support TCP_ULP. I think we can add the handling of this case. Signed-off-by: zhangmingyi --- net/core/filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/core/filter.c b/net/core/filter.c index 2ec162dd83c46..7b3f742967da6 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5391,6 +5391,10 @@ static int sol_tcp_sockopt(struct sock *sk, int optname, if (*optlen < 1) return -EINVAL; break; + case TCP_ULP: + if (getopt) + return -EINVAL; + break; case TCP_BPF_SOCK_OPS_CB_FLAGS: if (*optlen != sizeof(int)) return -EINVAL;