You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
network-3.2.8 is broken on Windows: fails with WSAENOPROTOOPT due to DontFragment socket option #608
Network.Socket
Read/Write
Network.Socket.exe: Network.Socket.setSockOpt: failed (Bad protocol option (WSAENOPROTOOPT))
HasCallStack backtrace:
collectBacktraces, called at libraries\ghc-internal\src\GHC\Internal\Exception.hs:169:13 in ghc-internal:GHC.Internal.Exception
toExceptionWithBacktrace, called at libraries\ghc-internal\src\GHC\Internal\IO.hs:260:11 in ghc-internal:GHC.Internal.IO
throwIO, called at libraries\ghc-internal\src\GHC\Internal\Control\Exception\Base.hs:195:43 in ghc-internal:GHC.Internal.Control.Exception.Base . The relevant
We are not setting any socket option in the test, so it has to be some code inside network package.
Version 3.2.8.0
sockopt: add IP_DONTFRAG/IP_MTU_DISCOVER option. https://github.com/haskell/network/pull/603
The following code is unguarded for windows:
setDontFragment s = when (family == AF_INET) $
#if HAVE_DECL_IP_DONTFRAG || HAVE_DECL_IP_MTU_DISCOVER
setSocketOption s DontFragment 1
#else
-- do nothing
return ()
#endif
What I see in the configure step in the failing build:
configure output in failing build:
[00:06:49] checking whether IP_DONTFRAG is declared... no
[00:06:50] checking whether IP_MTU_DISCOVER is declared... yes
IP_MTU_DISCOVER is causing the DontFragment option to be set which at runtime the OS is not allowing. A potential fix could be:
#if HAVE_DECL_IP_DONTFRAG
setSocketOption s DontFragment 1
#elif HAVE_DECL_IP_MTU_DISCOVER && !defined(mingw32_HOST_OS)
setSocketOption s DontFragment 1
#endif
Appveyor: OS: Windows (MSYS_NT-6.3-9600) -- this corresponds to Windows 8.1 / Windows Server 2012 R2
Github: OS: Windows (MINGW64_NT-10.0-26100) -- this corresponds to Windows 11 24H2
Looks like it fails on older windows systems but succeeds on newer ones.
Fixed by #605: socket now ignores a failure to set DontFragment, as it already did for IPv6Only. It is on master and has been backported to v3.2, so it will be in the next release of both. Thank you for the report and the investigation.
Activity
kazu-yamamoto commentedon Mar 11, 2026
@harendra-kumar Thank you for this report. Could you send a PR by yourself?
Cc: @thehajime
harendra-kumar commentedon Mar 12, 2026
If anyone else can't take it up I will try in some time.
harendra-kumar commentedon May 28, 2026
@kazu-yamamoto please approve the CI run in PR #615
harendra-kumar commentedon May 30, 2026
I enabled network 3.2.8 in streamly and noticed that windows build on github succeeds but on appveryor it fails:
Appveyor: OS: Windows (MSYS_NT-6.3-9600) -- this corresponds to Windows 8.1 / Windows Server 2012 R2
Github: OS: Windows (MINGW64_NT-10.0-26100) -- this corresponds to Windows 11 24H2
Looks like it fails on older windows systems but succeeds on newer ones.
kazu-yamamoto commentedon Nov 13, 2026
Fixed by #605:
socketnow ignores a failure to setDontFragment, as it already did forIPv6Only. It is on master and has been backported to v3.2, so it will be in the next release of both. Thank you for the report and the investigation.