Skip to content

Commit ed0c99d

Browse files
committed
tcp: ensure PMTU updates are processed during fastopen
tp->rx_opt.mss_clamp is not populated, yet, during TFO send so we rise it to the local MSS. tp->mss_cache is not updated, however: tcp_v6_connect(): tp->rx_opt.mss_clamp = IPV6_MIN_MTU - headers; tcp_connect(): tcp_connect_init(): tp->mss_cache = min(mtu, tp->rx_opt.mss_clamp) tcp_send_syn_data(): tp->rx_opt.mss_clamp = tp->advmss After recent fixes to ICMPv6 PTB handling we started dropping PMTU updates higher than tp->mss_cache. Because of the stale tp->mss_cache value PMTU updates during TFO are always dropped. Thanks to Wei for helping zero in on the problem and the fix! Fixes: c7bb4b8 ("ipv6: tcp: drop silly ICMPv6 packet too big messages") Reported-by: Andre Nash <alnash@fb.com> Reported-by: Neil Spring <ntspring@fb.com> Reviewed-by: Wei Wang <weiwan@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20220321165957.1769954-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8d3ea3d commit ed0c99d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

net/ipv4/tcp_output.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,6 +3719,7 @@ static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb)
37193719
*/
37203720
static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
37213721
{
3722+
struct inet_connection_sock *icsk = inet_csk(sk);
37223723
struct tcp_sock *tp = tcp_sk(sk);
37233724
struct tcp_fastopen_request *fo = tp->fastopen_req;
37243725
int space, err = 0;
@@ -3733,8 +3734,10 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
37333734
* private TCP options. The cost is reduced data space in SYN :(
37343735
*/
37353736
tp->rx_opt.mss_clamp = tcp_mss_clamp(tp, tp->rx_opt.mss_clamp);
3737+
/* Sync mss_cache after updating the mss_clamp */
3738+
tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
37363739

3737-
space = __tcp_mtu_to_mss(sk, inet_csk(sk)->icsk_pmtu_cookie) -
3740+
space = __tcp_mtu_to_mss(sk, icsk->icsk_pmtu_cookie) -
37383741
MAX_TCP_OPTION_SPACE;
37393742

37403743
space = min_t(size_t, space, fo->size);

0 commit comments

Comments
 (0)