Skip to content

Commit 906893c

Browse files
edumazetkuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1d2fbaa commit 906893c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
--mss=1000
4+
5+
`./defaults.sh`
6+
7+
0 `nstat -n`
8+
9+
// Establish a connection.
10+
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
11+
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
12+
+0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [20000], 4) = 0
13+
+0 bind(3, ..., ...) = 0
14+
+0 listen(3, 1) = 0
15+
16+
+0 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7>
17+
+0 > S. 0:0(0) ack 1 win 18980 <mss 1460,nop,wscale 0>
18+
+.1 < . 1:1(0) ack 1 win 257
19+
20+
+0 accept(3, ..., ...) = 4
21+
22+
+0 < P. 1:20001(20000) ack 1 win 257
23+
+.04 > . 1:1(0) ack 20001 win 18000
24+
25+
+0 setsockopt(4, SOL_SOCKET, SO_RCVBUF, [12000], 4) = 0
26+
+0 < P. 20001:80001(60000) ack 1 win 257
27+
+0 > . 1:1(0) ack 20001 win 18000
28+
29+
+0 read(4, ..., 20000) = 20000
30+
// A too big packet is accepted if the receive queue is empty
31+
+0 < P. 20001:80001(60000) ack 1 win 257
32+
+0 > . 1:1(0) ack 80001 win 0
33+

0 commit comments

Comments
 (0)