]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tcp: fastopen: note that a child socket was created
authorJeremy Harris <jgh@exim.org>
Wed, 23 Apr 2025 12:43:33 +0000 (13:43 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Apr 2025 01:21:04 +0000 (18:21 -0700)
tcp: fastopen: note that a child socket was created

This uses up the last bit in a field of tcp_sock.

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-2-jgh@exim.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/tcp.h
net/ipv4/tcp.c
net/ipv4/tcp_fastopen.c

index 1669d95bb0f9aa97e1e74b7b62bb252eb404fbfb..a8af71623ba7ca16f211cb9884f431fc9462ce9e 100644 (file)
@@ -385,7 +385,8 @@ struct tcp_sock {
                syn_fastopen:1, /* SYN includes Fast Open option */
                syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */
                syn_fastopen_ch:1, /* Active TFO re-enabling probe */
-               syn_data_acked:1;/* data in SYN is acked by SYN-ACK */
+               syn_data_acked:1,/* data in SYN is acked by SYN-ACK */
+               syn_fastopen_child:1; /* created TFO passive child socket */
 
        u8      keepalive_probes; /* num of allowed keep alive probes   */
        u32     tcp_tx_delay;   /* delay (in usec) added to TX packets */
index e0e96f8fd47cb57a4502ff3d316df9c1d9d12a3e..df3eb0fb7cb3d9cb5f40390ba613ebff33d6e0e6 100644 (file)
@@ -3409,6 +3409,7 @@ int tcp_disconnect(struct sock *sk, int flags)
        tp->rack.reo_wnd_persist = 0;
        tp->rack.dsack_seen = 0;
        tp->syn_data_acked = 0;
+       tp->syn_fastopen_child = 0;
        tp->rx_opt.saw_tstamp = 0;
        tp->rx_opt.dsack = 0;
        tp->rx_opt.num_sacks = 0;
index 1a6b1bc5424514e27a99cbb2fcedf001afd51d98..9b83d639b5acd2d8cb41136ba1be149c23f23c3b 100644 (file)
@@ -401,6 +401,7 @@ fastopen:
                                }
                                NET_INC_STATS(sock_net(sk),
                                              LINUX_MIB_TCPFASTOPENPASSIVE);
+                               tcp_sk(child)->syn_fastopen_child = 1;
                                return child;
                        }
                        NET_INC_STATS(sock_net(sk),