Description
Description
While DontFragment
doesn't make much sense on IPv6 itself, it is still useful for dual-stack sockets (an IPv6 socket that can handle IPv4 traffic too, through ::FFFF:x.x.x.x
IPv6 addresses).
Manually setting it via SetSocketOption(SocketOptionLevel.IP, SocketOptionName.DontFragment, true)
does work. The problem appears to be a rough top-level check in the DontFragment
property itself, nothing lower-level:
On both Windows and Linux, the flags are correctly respected when sending IPv4 traffic out of the IPv6 socket (at least, if my Wireshark isn't lying).
Reproduction Steps
using var s = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp);
s.DualMode = true;
s.Bind(IPEndPoint.Parse("[::]:1212"));
s.DontFragment = true;
Expected behavior
Don't fragment to be set on IPv4 sockets sent from the dual-stack socket.
Actual behavior
Unhandled exception. System.NotSupportedException: This protocol version is not supported.
Regression?
No response
Known Workarounds
SetSocketOption(SocketOptionLevel.IP, SocketOptionName.DontFragment, true);
works great.
Configuration
No response
Other information
No response