diff options
| author | Jason Xing <kerneljasonxing@gmail.com> | 2025-03-12 16:35:21 +0100 |
|---|---|---|
| committer | Martin KaFai Lau <martin.lau@kernel.org> | 2025-03-13 14:30:39 -0700 |
| commit | 5584cd7e0ddd0d4e6e91498864c4cd025445dafe (patch) | |
| tree | fec7aa6a43539e5bdcb86590b04432d8baabbe22 /net | |
| parent | 49f6713cb6913e1e62d98a36548c592b3d5d32df (diff) | |
tcp: bpf: Support bpf_getsockopt for TCP_BPF_RTO_MIN
Support bpf_getsockopt if application tries to know what the RTO MIN
of this socket is.
Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250312153523.9860-3-kerneljasonxing@gmail.com
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 2932de5cc57c..4d34d35af5c7 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -5295,6 +5295,12 @@ static int bpf_sol_tcp_getsockopt(struct sock *sk, int optname, memcpy(optval, &cb_flags, optlen); break; } + case TCP_BPF_RTO_MIN: { + int rto_min_us = jiffies_to_usecs(inet_csk(sk)->icsk_rto_min); + + memcpy(optval, &rto_min_us, optlen); + break; + } default: return -EINVAL; } |
