linux/tools/testing/selftests/net/packetdrill/tcp_rcv_toobig.pkt
Eric Dumazet 906893cf2c selftests/net: packetdrill: add tcp_rcv_toobig.pkt
Check that TCP receiver behavior after "tcp: stronger sk_rcvbuf checks"

Too fat packet is dropped unless receive queue is empty.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250711114006.480026-9-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-14 18:41:43 -07:00

34 lines
896 B
Plaintext

// SPDX-License-Identifier: GPL-2.0
--mss=1000
`./defaults.sh`
0 `nstat -n`
// Establish a connection.
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [20000], 4) = 0
+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7>
+0 > S. 0:0(0) ack 1 win 18980 <mss 1460,nop,wscale 0>
+.1 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4
+0 < P. 1:20001(20000) ack 1 win 257
+.04 > . 1:1(0) ack 20001 win 18000
+0 setsockopt(4, SOL_SOCKET, SO_RCVBUF, [12000], 4) = 0
+0 < P. 20001:80001(60000) ack 1 win 257
+0 > . 1:1(0) ack 20001 win 18000
+0 read(4, ..., 20000) = 20000
// A too big packet is accepted if the receive queue is empty
+0 < P. 20001:80001(60000) ack 1 win 257
+0 > . 1:1(0) ack 80001 win 0