update socket2 (#469)

This commit is contained in:
Logan McNaughton 2025-07-05 17:52:29 +02:00 committed by GitHub
parent 16732d3d3c
commit e4b7e291dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 9 deletions

24
Cargo.lock generated
View File

@ -704,9 +704,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.28"
version = "1.2.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ad45f4f74e4e20eaa392913b7b33a7091c87e59628f4dd27888205ad888843c"
checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362"
dependencies = [
"jobserver",
"libc",
@ -1960,7 +1960,7 @@ dependencies = [
"sha2",
"slint",
"slint-build",
"socket2",
"socket2 0.6.0",
"spin_sleep",
"tokio",
"tokio-tungstenite",
@ -2240,7 +2240,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
"socket2",
"socket2 0.5.10",
"tokio",
"tower-service",
"tracing",
@ -4103,7 +4103,7 @@ dependencies = [
"quinn-udp",
"rustc-hash 2.1.1",
"rustls",
"socket2",
"socket2 0.5.10",
"thiserror 2.0.12",
"tokio",
"tracing",
@ -4140,7 +4140,7 @@ dependencies = [
"cfg_aliases",
"libc",
"once_cell",
"socket2",
"socket2 0.5.10",
"tracing",
"windows-sys 0.59.0",
]
@ -5007,6 +5007,16 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "socket2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
dependencies = [
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "softbuffer"
version = "0.4.6"
@ -5416,7 +5426,7 @@ dependencies = [
"pin-project-lite",
"signal-hook-registry",
"slab",
"socket2",
"socket2 0.5.10",
"tokio-macros",
"tracing",
"windows-sys 0.52.0",

View File

@ -28,7 +28,7 @@ mimalloc = "0.1"
regex = "1.11"
tokio-tungstenite = "0.27"
futures = "0.3"
socket2 = "0.5"
socket2 = { version = "0.6", features = ["all"] }
rand_chacha = "0.9"
fatfs = "0.3"
semver = "1.0"

View File

@ -252,7 +252,7 @@ pub fn init(peer_addr: std::net::SocketAddr, player_number: u8) -> Netplay {
udp_socket = std::net::UdpSocket::bind((std::net::Ipv4Addr::UNSPECIFIED, 0))
.expect("couldn't bind to address");
socket2::SockRef::from(&udp_socket)
.set_tos(CS4 << 2)
.set_tos_v4(CS4 << 2)
.unwrap();
} else {
udp_socket = std::net::UdpSocket::bind((std::net::Ipv6Addr::UNSPECIFIED, 0))