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

Fix startup failure on Windows 8.1 due to unsupported IPV6_USER_MTU socket option being set #730

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

luisdallos
Copy link
Contributor

Newer mingw-w64 (starting from 8.0.1) introduces support for IPV6_USER_MTU socket option [1], which is not supported on Windows 8.1 and older [2]. As there is no way to avoid this socket option from being picked at compile time when targeting older versions of Windows, check for setsockopt(..., IPV6_USER_MTU, ...) failures at runtime in order to avoid startup failure on those versions of Windows where the IPV6_USER_MTU socket option is unsupported.

Fixes #729

[1] : mirror/mingw-w64@e30bff4
[2] : WSAGetLastError() returns WSAENOPROTOOPT (Bad protocol option) error code

See also:
https://sourceforge.net/p/uftp-multicast/discussion/general/thread/257f3c21/
https://stackoverflow.com/questions/49982697/

…ocket option being set

Newer mingw-w64 (starting from 8.0.1) introduces support for `IPV6_USER_MTU` socket
option [1], which is not supported on Windows 8.1 and older [2]. As there is no way
to avoid this socket option from being picked at compile time when targeting older
versions of Windows, check for `setsockopt(..., IPV6_USER_MTU, ...)` failures at
runtime in order to avoid startup failure on those versions of Windows where the
`IPV6_USER_MTU` socket option is unsupported.

[1]: mirror/mingw-w64@e30bff4
[2]: `WSAGetLastError()` returns `WSAENOPROTOOPT` (`Bad protocol option`) error code
Copy link
Member

@wcawijngaards wcawijngaards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me. It should improve the portability to different OS versions with different setsockopt support.

@wcawijngaards wcawijngaards merged commit e738ec3 into NLnetLabs:master Aug 2, 2022
wcawijngaards added a commit that referenced this pull request Aug 2, 2022
- Merge #730 from luisdallos: Fix startup failure on Windows 8.1 due
  to unsupported IPV6_USER_MTU socket option being set.
@wcawijngaards
Copy link
Member

Thanks for the fix, this looks similar to the fixes in the links you provided and I also think that it likely works well for users, since it adapts to different support levels at run time. Merged it into the code repository.

@luisdallos luisdallos deleted the win81-unsup-sockopt-fix branch August 3, 2022 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unbound 1.16.2: unable to start either as a service or from console in Windows 8.1
2 participants