]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tcp: fastopen: pass TFO child indication through getsockopt
authorJeremy Harris <jgh@exim.org>
Wed, 23 Apr 2025 12:43:34 +0000 (13:43 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Apr 2025 01:21:04 +0000 (18:21 -0700)
tcp: fastopen: pass TFO child indication through getsockopt

Note that this uses up the last bit of a field in struct tcp_info

Signed-off-by: Jeremy Harris <jgh@exim.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20250423124334.4916-3-jgh@exim.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/tcp.h
net/ipv4/tcp.c

index dc8fdc80e16b05ca4174c5fe683d13b36dd4dff4..bdac8c42fa82ab1b3b6aa6317248a24afbc8a465 100644 (file)
@@ -184,6 +184,7 @@ enum tcp_fastopen_client_fail {
 #define TCPI_OPT_ECN_SEEN      16 /* we received at least one packet with ECT */
 #define TCPI_OPT_SYN_DATA      32 /* SYN-ACK acked data in SYN sent or rcvd */
 #define TCPI_OPT_USEC_TS       64 /* usec timestamps */
+#define TCPI_OPT_TFO_CHILD     128 /* child from a Fast Open option on SYN */
 
 /*
  * Sender's congestion state indicating normal or abnormal situations
index df3eb0fb7cb3d9cb5f40390ba613ebff33d6e0e6..86c427f166367a4733b12a054313d3d9349ab1d1 100644 (file)
@@ -4165,6 +4165,8 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
                info->tcpi_options |= TCPI_OPT_SYN_DATA;
        if (tp->tcp_usec_ts)
                info->tcpi_options |= TCPI_OPT_USEC_TS;
+       if (tp->syn_fastopen_child)
+               info->tcpi_options |= TCPI_OPT_TFO_CHILD;
 
        info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto);
        info->tcpi_ato = jiffies_to_usecs(min_t(u32, icsk->icsk_ack.ato,