Fix the inheritance of IPv6 options from the listening socket. It should depend on whether the listener was created as an PF_INET6or not, not whether it used for an IPv6 connection or not. The difference is when using IPv4-mapped IPv6 addresses.
Details
Details
- Reviewers
bz rrs jason_eggnet.com - Group Reviewers
transport - Commits
- rS343431: MFC r338137:
rS338137: Fix the inheritance of IPv6 level socket options on TCP sockets.
Get the following packetdrill script passing:
--ip_version=ipv4_mapped_ipv6 0.00 `sysctl -w net.inet.tcp.hostcache.purgenow=1` +0.00 `sysctl -w net.inet.tcp.syncookies_only=0` +0.00 `sysctl -w net.inet.tcp.syncookies=1` +0.00 `sysctl -w net.inet.tcp.rfc1323=1` +0.00 `sysctl -w net.inet.tcp.sack.enable=1` +0.00 `sysctl -w net.inet.tcp.ecn.enable=2` +0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0.00 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0.00 setsockopt(3, IPPROTO_IPV6, IPV6_V6ONLY, [0], 4) = 0 +0.00 setsockopt(3, IPPROTO_IPV6, IPV6_USE_MIN_MTU, [1], 4) = 0 +0.00 bind(3, ..., ...) = 0 +0.00 listen(3, 1) = 0 +0.10 < S 0:0(0) win 65535 <mss 1460,sackOK,eol,eol> +0.00 > S. 0:0(0) ack 1 win 65535 <mss 1460,sackOK,eol,eol> +0.10 < . 1:1(0) ack 1 win 65535 +0.00 accept(3, ..., ...) = 4 +0.00 close(3) = 0 +0.00 getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 +0.00 getsockopt(4, IPPROTO_IPV6, IPV6_USE_MIN_MTU, [1], [4]) = 0 +0.00 getsockopt(4, IPPROTO_TCP, TCP_MAXSEG, [1460], [4]) = 0 +0.10 < F. 1:1(0) ack 1 win 65535 +0.00 > . 1:1(0) ack 2 win 65535 +0.00 close(4) = 0 +0.00 > F. 1:1(0) ack 2 win 65535 +0.05 < . 2:2(0) ack 2 win 65535
Without this patch it fails, since -1 is returned as optval in the IPV6_USE_MIN_MTU getsocktop() call.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable