mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 16:24:45 +00:00
transport: rename darwin_sockopts to sockopts_macos
The module is gated target_os="macos" (not the broader Darwin/iOS family), so the name now tracks the cfg and matches the *_macos.rs file convention (io_macos.rs). Drops the redundant inner #![cfg(target_os="macos")] (the decl gate already covers it) and corrects a stale top comment that claimed the module stays visible on Linux — it is macos-decl-gated, so it never was. Mechanical rename; no logic change.
This commit is contained in:
@@ -800,7 +800,7 @@ pub use platform::{AsyncUdpSocket, UdpRawSocket};
|
||||
///
|
||||
/// Gated to Linux/macOS: the rest of `io.rs` compiles more broadly
|
||||
/// (Windows uses `tokio::net::UdpSocket`), but the connected fast path
|
||||
/// is libc-syscall + `darwin_sockopts` specific.
|
||||
/// is libc-syscall + `sockopts_macos` specific.
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
mod connected {
|
||||
// The connected-UDP fast path is infra-ready but not yet wired into
|
||||
@@ -873,7 +873,7 @@ mod connected {
|
||||
set_sockopt_int(raw, libc::SOL_SOCKET, libc::SO_REUSEPORT, 1)?;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
crate::transport::udp::darwin_sockopts::apply_udp_socket_tuning(raw, "connected-udp-peer");
|
||||
crate::transport::udp::sockopts_macos::apply_udp_socket_tuning(raw, "connected-udp-peer");
|
||||
|
||||
// Buffer sizes — try the FORCE variants first (succeed if we
|
||||
// have CAP_NET_ADMIN), then fall back to the ceiling-clamped
|
||||
|
||||
@@ -6,9 +6,9 @@ use super::{
|
||||
DiscoveredPeer, PacketTx, ReceivedPacket, Transport, TransportAddr, TransportError,
|
||||
TransportId, TransportState, TransportType,
|
||||
};
|
||||
#[cfg(target_os = "macos")]
|
||||
pub(crate) mod darwin_sockopts;
|
||||
pub(crate) mod io;
|
||||
#[cfg(target_os = "macos")]
|
||||
pub(crate) mod sockopts_macos;
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
pub(crate) use io::open_connected_fd;
|
||||
mod stats;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Applied inside `io::open_connected_fd` (dormant in this PR; see
|
||||
// `io.rs`). Linux toolchain only checks gates — keep the module
|
||||
// visible on Linux so clippy doesn't lose track.
|
||||
// Applied inside `io::open_connected_fd` (see `io.rs`), dormant until
|
||||
// the connected-UDP fast path is wired into dispatch — hence the allow.
|
||||
#![allow(dead_code)]
|
||||
|
||||
//! Darwin UDP socket tuning.
|
||||
@@ -10,8 +9,6 @@
|
||||
//! service type is the one low-cost Darwin hint that can change how the
|
||||
//! socket is queued by the host networking stack and Wi-Fi WMM.
|
||||
|
||||
#![cfg(target_os = "macos")]
|
||||
|
||||
use std::io;
|
||||
use std::os::fd::RawFd;
|
||||
use std::sync::OnceLock;
|
||||
Reference in New Issue
Block a user