about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-01 03:41:50 +0100
committerGitHub <noreply@github.com>2022-03-01 03:41:50 +0100
commit06d47a414bdf6be59fe8393fdd1ccb0247dce6f2 (patch)
treea210e0af1072c1d2a643249d0edc9a4549a6d2e5 /compiler/rustc_codegen_llvm/src
parentdaed86445de99e6dfcf128948bf34fff96c733ef (diff)
parentb02698c7e6843d6feacc394cb7f83f3fc347c3e2 (diff)
downloadrust-06d47a414bdf6be59fe8393fdd1ccb0247dce6f2.tar.gz
rust-06d47a414bdf6be59fe8393fdd1ccb0247dce6f2.zip
Rollup merge of #94094 - chrisnc:tcp-nodelay-windows-bool, r=dtolnay
use BOOL for TCP_NODELAY setsockopt value on Windows

This issue was found by the Wine project and mitigated there [^1].

Windows' setsockopt expects a BOOL (a typedef for int) for TCP_NODELAY
[^2]. Windows itself is forgiving and will accept any positive optlen and
interpret the first byte of *optval as the value, so this bug does not
affect Windows itself, but does affect systems implementing Windows'
interface more strictly, such as Wine. Wine was previously passing this
through to the host's setsockopt, where, e.g., Linux requires that
optlen be correct for the chosen option, and TCP_NODELAY expects an int.

[^1]: https://source.winehq.org/git/wine.git/commit/d6ea38f32dfd3edbe107a255c37e9f7f3da06ae7
[^2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-setsockopt
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions