Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "mptcp: new tests to validate IP_TTL and IPV6_UNICAST_HOPS sockopts"" #127

Draft
wants to merge 1 commit into
base: mptcp-net-next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions gtests/net/mptcp/sockopts/ip_ttl_v4.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Send data with MSG_FASTOPEN
--tolerance_usecs=400000
`../common/defaults.sh`

0.0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0.0 getsockopt(3, SOL_IP, IP_TTL, [64], [4]) = 0
+0.0 setsockopt(3, SOL_IP, IP_TTL, [1], 4) = 0
+0.0 getsockopt(3, SOL_IP, IP_TTL, [1], [4]) = 0

+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0

+0.0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)

+0.01 > [ttl 1] S 0:0(0) <mss 1460, sackOK, TS val 100 ecr 0, nop, wscale 8, mpcapable v1 flags[flag_h] nokey>
+0.01 < [ttl 1] S. 0:0(0) ack 1 win 65535 <mss 1460, sackOK, TS val 700 ecr 100, nop, wscale 8, mpcapable v1 flags[flag_h] key[skey=2]>
+0.01 > [ttl 1] . 1:1(0) ack 1 <nop, nop, TS val 100 ecr 700, mpcapable v1 flags[flag_h] key[ckey, skey]>

+0.0 fcntl(3, F_SETFL, O_RDWR) = 0 // set back to blocking
+0.0 setsockopt(3, SOL_IP, IP_TTL, [2], 4) = 0
+0.0 getsockopt(3, SOL_IP, IP_TTL, [2], [4]) = 0

+0.1 write(3, ..., 2) = 2

+0.0 > [ttl 2] P. 1:3(2) ack 1 <nop, nop, TS val 100 ecr 700, mpcapable v1 flags[flag_h] key[ckey, skey] mpcdatalen 2, nop, nop>
25 changes: 25 additions & 0 deletions gtests/net/mptcp/sockopts/ipv6_unicast_hops_v6.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Send data with MSG_FASTOPEN
--tolerance_usecs=400000
`../common/defaults.sh`

0.0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0.0 getsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [64], [4]) = 0
+0.0 setsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [1], 4) = 0
+0.0 getsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [1], [4]) = 0

+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0

+0.0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)

+0.01 > [ttl 1] S 0:0(0) <mss 1460, sackOK, TS val 100 ecr 0, nop, wscale 8, mpcapable v1 flags[flag_h] nokey>
+0.01 < [ttl 1] S. 0:0(0) ack 1 win 65535 <mss 1460, sackOK, TS val 700 ecr 100, nop, wscale 8, mpcapable v1 flags[flag_h] key[skey=2]>
+0.01 > [ttl 1] . 1:1(0) ack 1 <nop, nop, TS val 100 ecr 700, mpcapable v1 flags[flag_h] key[ckey, skey]>

+0.0 fcntl(3, F_SETFL, O_RDWR) = 0 // set back to blocking
+0.0 setsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [2], 4) = 0
+0.0 getsockopt(3, SOL_IPV6, IPV6_UNICAST_HOPS, [2], [4]) = 0

+0.1 write(3, ..., 2) = 2

+0.0 > [ttl 2] P. 1:3(2) ack 1 <nop, nop, TS val 100 ecr 700, mpcapable v1 flags[flag_h] key[ckey, skey] mpcdatalen 2, nop, nop>
1 change: 1 addition & 0 deletions gtests/net/packetdrill/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct ipv6 {
};

#ifdef linux
#define IPV6_UNICAST_HOPS 16
#define IPV6_HOPLIMIT 52
#define IPV6_TCLASS 67
#endif /* linux */
Expand Down
1 change: 1 addition & 0 deletions gtests/net/packetdrill/symbols_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ struct int_symbol platform_symbols_table[] = {
#ifdef IPV6_MTU
{ IPV6_MTU, "IPV6_MTU" },
#endif
{ IPV6_UNICAST_HOPS, "IPV6_UNICAST_HOPS" },
{ IPV6_TCLASS, "IPV6_TCLASS" },
{ IPV6_HOPLIMIT, "IPV6_HOPLIMIT" },

Expand Down