From 43255ac602b5096e3589b92e2200d7a6941675ab Mon Sep 17 00:00:00 2001 From: shellrow <81893184+shellrow@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:31:18 +0900 Subject: [PATCH] Update mod.rs --- src/gateway/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index 32897c4..8598778 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -4,7 +4,6 @@ pub mod unix; #[cfg(any(target_os = "linux", target_os = "android"))] pub mod linux; -use std::net::UdpSocket; use std::net::{IpAddr, Ipv4Addr}; use crate::interface::{self, MacAddr, Interface}; @@ -52,7 +51,9 @@ pub fn get_default_gateway() -> Result { Err(String::from("Default Gateway not found")) } +#[cfg(not(target_os="windows"))] fn send_udp_packet() -> Result<(), String> { + use std::net::UdpSocket; let buf = [0u8; 0]; let socket = match UdpSocket::bind("0.0.0.0:0") { Ok(s) => s,