Page MenuHomeFreeBSD

Fix inheritance of IPv6 options
ClosedPublic

Authored by tuexen on Aug 18 2018, 4:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 21 2024, 5:48 AM
Unknown Object (File)
Dec 20 2023, 1:38 AM
Unknown Object (File)
Dec 13 2023, 8:32 AM
Unknown Object (File)
Nov 8 2023, 11:04 PM
Unknown Object (File)
Nov 8 2023, 12:23 PM
Unknown Object (File)
Sep 25 2023, 4:16 AM
Unknown Object (File)
Sep 25 2023, 4:16 AM
Unknown Object (File)
Sep 25 2023, 4:13 AM
Subscribers

Details

Summary

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.

Test Plan

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable