mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 19:24:01 -04:00
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
This commit is contained in:
committed by
Martin KaFai Lau
parent
49f6713cb6
commit
5584cd7e0d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user