Skip to content

Commit 5584cd7

Browse files
JasonXingMartin KaFai Lau
authored andcommitted
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 <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 49f6713 commit 5584cd7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/core/filter.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5295,6 +5295,12 @@ static int bpf_sol_tcp_getsockopt(struct sock *sk, int optname,
52955295
memcpy(optval, &cb_flags, optlen);
52965296
break;
52975297
}
5298+
case TCP_BPF_RTO_MIN: {
5299+
int rto_min_us = jiffies_to_usecs(inet_csk(sk)->icsk_rto_min);
5300+
5301+
memcpy(optval, &rto_min_us, optlen);
5302+
break;
5303+
}
52985304
default:
52995305
return -EINVAL;
53005306
}

0 commit comments

Comments
 (0)