From 78c896b3b3127515478090c19447e27dc406427e Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Mon, 18 Nov 2019 06:59:50 +0000 Subject: TLDKv2 Signed-off-by: Jianfeng Tan Signed-off-by: Jielong Zhou Signed-off-by: Jian Zhang Signed-off-by: Chen Zhao Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e --- ...ss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/packetdrill/tests/linux/mss/mss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt (limited to 'test/packetdrill/tests/linux/mss/mss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt') diff --git a/test/packetdrill/tests/linux/mss/mss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt b/test/packetdrill/tests/linux/mss/mss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt new file mode 100644 index 0000000..c07c5c0 --- /dev/null +++ b/test/packetdrill/tests/linux/mss/mss-getsockopt-tcp_maxseg-server-advmss-ipv4.pkt @@ -0,0 +1,29 @@ +// Test that getsockopt of TCP_MAXSEG works on passive/server TCP connections. +// In this variant we test that we get the expected result when +// the routing config specifies an "advmss 1430 mtu lock 1470" for the +// route to the remote IP under test. + +// To ensure that we do not cache something that interferes with other tests: +--remote_ip="192.0.2.2" + +`ip route change 192.0.2.2 via 192.168.0.2 dev tun0 advmss 1430 mtu lock 1470` + +// Set up a listening socket. +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 ++0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 ++0 bind(3, ..., ...) = 0 ++0 listen(3, 1) = 0 + +// Establish a connection without timestamps. ++0 < S 0:0(0) win 32792 ++0 > S. 0:0(0) ack 1 ++0 < . 1:1(0) ack 1 win 257 + ++0 accept(3, ..., ...) = 4 + +// Verify that the kernel returns the expected TCP max payload size. ++0 getsockopt(4, SOL_TCP, TCP_MAXSEG, [1430], [4]) = 0 + ++0 write(4, ..., 1500) = 1500 ++0 > . 1:1431(1430) ack 1 ++0 > P. 1431:1501(70) ack 1 -- cgit 1.2.3-korg