Commit 906893cf authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250711114006.480026-9-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1d2fbaad
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
// 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