diff --git a/crates/lib/src/socket.rs b/crates/lib/src/socket.rs index 6161592..c76d0ef 100644 --- a/crates/lib/src/socket.rs +++ b/crates/lib/src/socket.rs @@ -61,6 +61,7 @@ pub trait Socket { /// /// # Returns /// The local SocketAddr. + #[cfg(feature = "packet_capture")] fn local_addr(&self) -> std::io::Result; } @@ -112,6 +113,8 @@ impl Socket for TcpSocketImpl { } fn port(&self) -> u16 { self.address.port() } + + #[cfg(feature = "packet_capture")] fn local_addr(&self) -> std::io::Result { self.socket.local_addr() } } @@ -164,6 +167,8 @@ impl Socket for UdpSocketImpl { } fn port(&self) -> u16 { self.address.port() } + + #[cfg(feature = "packet_capture")] fn local_addr(&self) -> std::io::Result { self.socket.local_addr() } }