Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tcp-fix-dsack-bug-with-non-contiguous-ranges'

Eric Dumazet says:

====================
tcp: fix DSACK bug with non contiguous ranges

This series combines a fix from xin.guo and a new packetdrill test.
====================

Link: https://patch.msgid.link/20250626123420.1933835-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+47 -1
+2 -1
net/ipv4/tcp_input.c
··· 4845 4845 4846 4846 if (before(TCP_SKB_CB(skb)->seq, dsack_high)) { 4847 4847 __u32 dsack = dsack_high; 4848 + 4848 4849 if (before(TCP_SKB_CB(skb)->end_seq, dsack_high)) 4849 - dsack_high = TCP_SKB_CB(skb)->end_seq; 4850 + dsack = TCP_SKB_CB(skb)->end_seq; 4850 4851 tcp_dsack_extend(sk, TCP_SKB_CB(skb)->seq, dsack); 4851 4852 } 4852 4853 p = rb_next(p);
+45
tools/testing/selftests/net/packetdrill/tcp_dsack_mult.pkt
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Test various DSACK (RFC 2883) behaviors. 3 + 4 + --mss=1000 5 + 6 + `./defaults.sh` 7 + 8 + 9 + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 10 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 11 + +0 bind(3, ..., ...) = 0 12 + +0 listen(3, 1) = 0 13 + 14 + +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7> 15 + +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8> 16 + +.1 < . 1:1(0) ack 1 win 1024 17 + +0 accept(3, ..., ...) = 4 18 + 19 + // First SACK range. 20 + +0 < P. 1001:2001(1000) ack 1 win 1024 21 + +0 > . 1:1(0) ack 1 <nop, nop, sack 1001:2001> 22 + 23 + // Check SACK coalescing (contiguous sequence). 24 + +0 < P. 2001:3001(1000) ack 1 win 1024 25 + +0 > . 1:1(0) ack 1 <nop,nop,sack 1001:3001> 26 + 27 + // Check we have two SACK ranges for non contiguous sequences. 28 + +0 < P. 4001:5001(1000) ack 1 win 1024 29 + +0 > . 1:1(0) ack 1 <nop,nop,sack 4001:5001 1001:3001> 30 + 31 + // Three ranges. 32 + +0 < P. 7001:8001(1000) ack 1 win 1024 33 + +0 > . 1:1(0) ack 1 <nop,nop,sack 7001:8001 4001:5001 1001:3001> 34 + 35 + // DSACK (1001:3001) + SACK (6001:7001) 36 + +0 < P. 1:6001(6000) ack 1 win 1024 37 + +0 > . 1:1(0) ack 6001 <nop,nop,sack 1001:3001 7001:8001> 38 + 39 + // DSACK (7001:8001) 40 + +0 < P. 6001:8001(2000) ack 1 win 1024 41 + +0 > . 1:1(0) ack 8001 <nop,nop,sack 7001:8001> 42 + 43 + // DSACK for an older segment. 44 + +0 < P. 1:1001(1000) ack 1 win 1024 45 + +0 > . 1:1(0) ack 8001 <nop,nop,sack 1:1001>