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
IP_ADD_MEMBERSHIP constant not correctly defined for Windows #20381
OS Error 10042: An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call
Doing some digging, I found a MS KB article that seems to directly mention this:
If the project is linked with Ws2_32.lib, setsockopt will fail with runtime error 10042 (WSAENOPROTOOPT). This is because in Winsock.h, IP_ADD_MEMBERSHIP is defined as "5". The corresponding Winsock runtime can not resolve option 5 at the IPPROTO_IP level, so the failure occurs with error code 10042.
Activity
emberian commentedon Jan 1, 2015
cc @aturon @alexcrichton are there any subtlties here around windows versioning that would prevent the simple change to 12?
alexcrichton commentedon Jan 2, 2015
Sounds like changing it to 12 should be good enough! Adding a test would probably also be worth it.
shepmaster commentedon Jan 2, 2015
And to be clear, it's not just the one constant that is troublesome.
It looks like:
Should all be checked
danslapman commentedon Jan 6, 2015
Experiencing the same error in windows 8.1
alexcrichton commentedon Feb 11, 2015
Fixed in #21267
Merge pull request rust-lang#20381 from A4-Tacks/fix-assign-sug
Merge pull request rust-lang#20381 from A4-Tacks/fix-assign-sug
Merge pull request rust-lang#20381 from A4-Tacks/fix-assign-sug