transport: Fix orig-dst compilation on non-Linux targets
The `orig_dst_addr` helper function does not compile when the target OS
is not Linux. This change fixes the signature and return value of the helper
for non-Linux targets
@@ -86,11 +86,11 @@ fn orig_dst_addr(sock: &TcpStream) -> io::Result<OrigDstAddr> {
}
#[cfg(not(target_os = "linux"))]
-fn orig_dst_addr(&self, _: &TcpStream) -> io::Result<OrigDstAddr> {
- io::Error::new(
+fn orig_dst_addr(_: &TcpStream) -> io::Result<OrigDstAddr> {
+ Err(io::Error::new(
io::ErrorKind::Other,
"SO_ORIGINAL_DST not supported on this operating system",
- )
+ ))
}
#[cfg(target_os = "linux")]
