mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-19 21:39:09 +00:00
Merge branch 'master' of https://github.com/sujiacong/tun2proxy
This commit is contained in:
commit
d4e2fca83a
3 changed files with 7 additions and 7 deletions
10
Cargo.toml
10
Cargo.toml
|
@ -42,11 +42,6 @@ url = "2"
|
|||
[target.'cfg(target_os="linux")'.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
bincode = "1"
|
||||
nix = { version = "0.29", default-features = false, features = [
|
||||
"fs",
|
||||
"socket",
|
||||
"uio",
|
||||
] }
|
||||
|
||||
[target.'cfg(target_os="android")'.dependencies]
|
||||
android_logger = "0.14"
|
||||
|
@ -54,6 +49,11 @@ jni = { version = "0.21", default-features = false }
|
|||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
daemonize = "0.5"
|
||||
nix = { version = "0.29", default-features = false, features = [
|
||||
"fs",
|
||||
"socket",
|
||||
"uio",
|
||||
] }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
windows-service = "0.7"
|
||||
|
|
|
@ -184,7 +184,7 @@ async fn process_udp(addr: SocketAddr, udp_timeout: u64, tx: Sender<Vec<u8>>, co
|
|||
std::net::UdpSocket::bind("0.0.0.0:0")?
|
||||
};
|
||||
std_sock.set_nonblocking(true)?;
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(unix)]
|
||||
nix::sys::socket::setsockopt(&std_sock, nix::sys::socket::sockopt::ReuseAddr, &true)?;
|
||||
let socket = UdpSocket::from_std(std_sock)?;
|
||||
socket.send_to(&con.data, &con.server_addr).await?;
|
||||
|
|
|
@ -6,7 +6,7 @@ pub enum Error {
|
|||
#[error(transparent)]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(unix)]
|
||||
#[error("nix::errno::Errno {0:?}")]
|
||||
NixErrno(#[from] nix::errno::Errno),
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue