diff --git a/Cargo.lock b/Cargo.lock index 0929673264cf..7665585432f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27772,7 +27772,7 @@ version . 5 . -6 +8 " source = @@ -27800,7 +27800,7 @@ index checksum = " -e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780 +52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527 " dependencies = diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index b79ffba43c3e..f69d81a6dbe5 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -36671,6 +36671,54 @@ delta [ audits . +quinn +- +udp +] +] +who += +" +Max +Inden +< +mail +max +- +inden +. +de +> +" +criteria += +" +safe +- +to +- +deploy +" +delta += +" +0 +. +5 +. +6 +- +> +0 +. +5 +. +8 +" +[ +[ +audits +. quote ] ] diff --git a/third_party/rust/quinn-udp/.cargo-checksum.json b/third_party/rust/quinn-udp/.cargo-checksum.json index 609c87073be7..ee7b6750b299 100644 --- a/third_party/rust/quinn-udp/.cargo-checksum.json +++ b/third_party/rust/quinn-udp/.cargo-checksum.json @@ -11,7 +11,7 @@ toml " : " -865febc6bb7b0a6f4d0758779480f829f96fcd6a614b64db05b5ea53e902fd5c +5f3321d35730fb66ae6d4637b39852087fa5950c3a2d1b078ffa75ee0ff172d2 " " LICENSE @@ -49,7 +49,7 @@ rs " : " -8e81067cac9fbe675619c3314d5aa06d99cf54c332812a837a227eeab41c92e1 +f15147312964f6a6dfc1a3b3d9645022c14a7be8bdb9bd321afc9a218235b431 " " src @@ -121,7 +121,7 @@ rs " : " -b8e595499055115d15bfb95259c0c585934adf55f61e365bcc9fc47ab8fa9cdd +214e078d745afd1cfe8be0880c492c2792a0cbfe6c21e74d4b9a4f47c92f0ae8 " " src @@ -132,7 +132,7 @@ rs " : " -ab1928d18bed62162a0f2c96158d808d7a2962045ab47c9efa0ecf60e2a2c060 +c37b86003f815219f547420b14bd9f4b9172315122f8ea398c20e1cb3b35673a " " tests @@ -143,7 +143,7 @@ rs " : " -3ab6c02756098d3933542baff06fa1f2ad6bba11852466f6843b8a42a9cc97c0 +6563e5d1d2c695616c590b3b92b58a7672351d85de47f2a2f6da008b909bccb3 " } " @@ -151,6 +151,6 @@ package " : " -e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780 +52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527 " } diff --git a/third_party/rust/quinn-udp/Cargo.toml b/third_party/rust/quinn-udp/Cargo.toml index 3a46b58e8105..0dfe50032133 100644 --- a/third_party/rust/quinn-udp/Cargo.toml +++ b/third_party/rust/quinn-udp/Cargo.toml @@ -109,9 +109,7 @@ version " 1 . -70 -. -0 +71 " name = @@ -127,7 +125,7 @@ version . 5 . -6 +8 " build = @@ -136,6 +134,9 @@ build . rs " +autolib += +false autobins = false @@ -537,4 +538,10 @@ Win32_System_IO " Win32_Networking_WinSock " +" +Win32_System_SystemInformation +" +" +Win32_System_Threading +" ] diff --git a/third_party/rust/quinn-udp/build.rs b/third_party/rust/quinn-udp/build.rs index 8368824c639f..81153d23e928 100644 --- a/third_party/rust/quinn-udp/build.rs +++ b/third_party/rust/quinn-udp/build.rs @@ -64,6 +64,23 @@ netbsd " ) } +solarish +: +{ +any +( +target_os += +" +solaris +" +target_os += +" +illumos +" +) +} / / Convenience diff --git a/third_party/rust/quinn-udp/src/unix.rs b/third_party/rust/quinn-udp/src/unix.rs index 1e817d2acbf3..b8430ede7b1a 100644 --- a/third_party/rust/quinn-udp/src/unix.rs +++ b/third_party/rust/quinn-udp/src/unix.rs @@ -12,11 +12,7 @@ target_os " openbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -99,10 +95,6 @@ super : { cmsg -log -: -: -debug log_sendmsg_error EcnCodepoint RecvMeta @@ -495,11 +487,7 @@ android cfg ! ( -target_os -= -" -solaris -" +solarish ) { cmsg_platform_space @@ -677,11 +665,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -721,6 +705,12 @@ IP_RECVTOS OPTION_ON ) { +crate +: +: +log +: +: debug ! ( @@ -768,17 +758,6 @@ android ) ] { -# -[ -cfg -( -target_os -= -" -linux -" -) -] let _ = @@ -791,7 +770,7 @@ libc : : SOL_UDP -libc +gro : : UDP_GRO @@ -865,7 +844,7 @@ IPV6_MTU_DISCOVER libc : : -IP_PMTUDISC_PROBE +IPV6_PMTUDISC_PROBE ) ? ; @@ -921,11 +900,7 @@ any ( bsd apple -target_os -= -" -solaris -" +solarish ) ) ] @@ -1738,11 +1713,19 @@ _ [ cfg ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ] if @@ -1784,13 +1767,20 @@ crate log : : -error +info ! ( " -got -transmit -error +libc +: +: +sendmsg +failed +with +{ +e +} +; halting segmentation offload @@ -2161,6 +2151,8 @@ cnt 1 ; } +loop +{ let n = @@ -2187,18 +2179,11 @@ u32 ; if n -> = -0 += +- +1 { -return -Ok -( -( -) -) -; -} let e = @@ -2229,6 +2214,8 @@ Interrupted = > { +continue +; } io : @@ -2264,24 +2251,24 @@ libc EMSGSIZE ) { -log_sendmsg_error +return +Err ( -& -state -. -last_send_error e -transmit ) ; } } } +} +return Ok ( ( ) ) +; +} } # [ @@ -2455,6 +2442,8 @@ sendmsg_einval ) ) ; +loop +{ let n = @@ -2513,6 +2502,8 @@ Interrupted = > { +continue +; } io : @@ -2558,11 +2549,14 @@ e } } } +return Ok ( ( ) ) +; +} } # [ @@ -2581,8 +2575,9 @@ openbsd target_os = " -solaris +netbsd " +solarish ) ) ) @@ -3233,6 +3228,7 @@ target_os " netbsd " +solarish apple_slow ) ) @@ -3827,6 +3823,24 @@ segment_size transmit . segment_size +. +filter +( +| +segment_size +| +* +segment_size +! += +transmit +. +contents +. +len +( +) +) { gso : @@ -3956,11 +3970,7 @@ any ( bsd apple -target_os -= -" -solaris -" +solarish ) ) ] @@ -4530,11 +4540,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -4911,11 +4917,19 @@ s6_addr [ cfg ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ] ( @@ -4923,7 +4937,7 @@ libc : : SOL_UDP -libc +gro : : UDP_GRO @@ -5200,11 +5214,19 @@ usize [ cfg ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ] mod @@ -5216,6 +5238,54 @@ super : * ; +# +[ +cfg +( +not +( +target_os += +" +android +" +) +) +] +const +UDP_SEGMENT +: +libc +: +: +c_int += +libc +: +: +UDP_SEGMENT +; +# +[ +cfg +( +target_os += +" +android +" +) +] +const +UDP_SEGMENT +: +libc +: +: +c_int += +103 +; pub ( crate @@ -5315,9 +5385,6 @@ libc : : SOL_UDP -libc -: -: UDP_SEGMENT GSO_SIZE ) @@ -5332,13 +5399,44 @@ Ok 64 Err ( -_ +_e ) = > +{ +crate +: +: +log +: +: +debug +! +( +" +failed +to +set +UDP_SEGMENT +socket +option +( +{ +_e +} +) +; +setting +max_gso_segments += +1 +" +) +; 1 } } +} pub ( crate @@ -5373,9 +5471,6 @@ libc : : SOL_UDP -libc -: -: UDP_SEGMENT segment_size ) @@ -5388,11 +5483,19 @@ cfg ( not ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ) ] @@ -5417,8 +5520,30 @@ max_gso_segments > usize { +# +[ +cfg +( +apple_fast +) +] +{ BATCH_SIZE } +# +[ +cfg +( +not +( +apple_fast +) +) +] +{ +1 +} +} pub ( super @@ -5479,11 +5604,19 @@ u16 [ cfg ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ] mod @@ -5495,6 +5628,62 @@ super : * ; +# +[ +cfg +( +not +( +target_os += +" +android +" +) +) +] +pub +( +crate +) +const +UDP_GRO +: +libc +: +: +c_int += +libc +: +: +UDP_GRO +; +# +[ +cfg +( +target_os += +" +android +" +) +] +pub +( +crate +) +const +UDP_GRO +: +libc +: +: +c_int += +104 +; pub ( crate @@ -5584,9 +5773,6 @@ libc : : SOL_UDP -libc -: -: UDP_GRO OPTION_ON ) @@ -5826,11 +6012,19 @@ cfg ( not ( +any +( target_os = " linux " +target_os += +" +android +" +) ) ) ] diff --git a/third_party/rust/quinn-udp/src/windows.rs b/third_party/rust/quinn-udp/src/windows.rs index eeb5455040b3..f0f47dd723e8 100644 --- a/third_party/rust/quinn-udp/src/windows.rs +++ b/third_party/rust/quinn-udp/src/windows.rs @@ -64,10 +64,28 @@ windows_sys Win32 : : +{ Networking : : WinSock +System +: +: +{ +SystemInformation +: +: +IMAGE_FILE_MACHINE_ARM64 +Threading +: +: +{ +GetCurrentProcess +IsWow64Process2 +} +} +} ; use crate @@ -84,10 +102,7 @@ CMsgHdr log : : -{ debug -error -} log_sendmsg_error EcnCodepoint RecvMeta @@ -418,20 +433,6 @@ is_none ( ) { -error -! -( -" -network -stack -does -not -support -WSARecvMsg -function -" -) -; return Err ( @@ -441,7 +442,7 @@ io Error : : -from +new ( io : @@ -450,6 +451,15 @@ ErrorKind : : Unsupported +" +network +stack +does +not +support +WSARecvMsg +function +" ) ) ; @@ -576,7 +586,43 @@ OPTION_ON ? ; } -_ +match +& +* +IS_WINDOWS_ON_ARM +{ +Ok +( +true +) += +> +{ +debug +! +( +" +detected +Windows +on +ARM +host +thus +not +enabling +URO +" +) +} +Ok +( +false +) += +> +{ +let +result = set_socket_option ( @@ -601,6 +647,61 @@ as u32 ) ; +if +let +Err +( +_e +) += +result +{ +debug +! +( +" +failed +to +enable +URO +: +{ +_e +} +" +) +; +} +} +Err +( +_e +) += +> +{ +debug +! +( +" +failed +to +detect +host +system +thus +not +enabling +URO +: +{ +_e +} +" +) +; +} +} let now = @@ -2653,3 +2754,100 @@ _ } ) ; +static +IS_WINDOWS_ON_ARM +: +Lazy +< +io +: +: +Result +< +bool +> +> += +Lazy +: +: +new +( +| +| +{ +let +mut +process_machine +: +u16 += +0 +; +let +mut +native_machine +: +u16 += +0 +; +let +result += +unsafe +{ +IsWow64Process2 +( +GetCurrentProcess +( +) +& +mut +process_machine +as +* +mut +u16 +& +mut +native_machine +as +* +mut +u16 +) +} +; +match +result +{ +0 += +> +Err +( +io +: +: +Error +: +: +last_os_error +( +) +) +_ += +> +Ok +( +native_machine += += +IMAGE_FILE_MACHINE_ARM64 +) +} +} +) +; diff --git a/third_party/rust/quinn-udp/tests/tests.rs b/third_party/rust/quinn-udp/tests/tests.rs index d79a77b6fdbf..8ea462c14bcc 100644 --- a/third_party/rust/quinn-udp/tests/tests.rs +++ b/third_party/rust/quinn-udp/tests/tests.rs @@ -16,11 +16,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -367,11 +363,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -521,11 +513,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -849,11 +837,7 @@ target_os " netbsd " -target_os -= -" -solaris -" +solarish ) ) ) @@ -1105,6 +1089,11 @@ target_os " windows " +target_os += +" +android +" ) ) ignore @@ -1362,7 +1351,7 @@ unwrap ; send_state . -send +try_send ( send .