diff --git a/Cargo.lock b/Cargo.lock index a5c70b070375..9eba1a3bdeaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2431,9 +2431,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smoltcp" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9786ac45091b96f946693e05bfa4d8ca93e2d3341237d97a380107a6b38dea" +checksum = "8d2e3a36ac8fea7b94e666dfa3871063d6e0a5c9d5d4fec9a1a6b7b6760f0229" dependencies = [ "bitflags 1.3.2", "byteorder", diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index 9e29e8d69f3b..556d047aa144 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -116,7 +116,7 @@ regex = "1.4" tun = { version = "0.5.5", optional = true, features = ["async"] } etherparse = { version = "0.13", optional = true } -smoltcp = { version = "0.9", optional = true, default-features = false, features = ["std", "log", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp"] } +smoltcp = { version = "0.10", optional = true, default-features = false, features = ["std", "log", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp"] } serde = { version = "1.0", features = ["derive"] } json5 = "0.4" diff --git a/crates/shadowsocks-service/src/local/tun/tcp.rs b/crates/shadowsocks-service/src/local/tun/tcp.rs index d933bbac61fc..35b63e531726 100644 --- a/crates/shadowsocks-service/src/local/tun/tcp.rs +++ b/crates/shadowsocks-service/src/local/tun/tcp.rs @@ -21,7 +21,7 @@ use smoltcp::{ socket::tcp::{Socket as TcpSocket, SocketBuffer as TcpSocketBuffer, State as TcpState}, storage::RingBuffer, time::{Duration as SmolDuration, Instant as SmolInstant}, - wire::{IpAddress, IpCidr, Ipv4Address, Ipv6Address, TcpPacket}, + wire::{HardwareAddress, IpAddress, IpCidr, Ipv4Address, Ipv6Address, TcpPacket}, }; use spin::Mutex as SpinMutex; use tokio::{ @@ -258,9 +258,9 @@ impl TcpTun { let (mut device, iface_rx, iface_tx, iface_tx_avail) = VirtTunDevice::new(capabilities); - let mut iface_config = InterfaceConfig::default(); + let mut iface_config = InterfaceConfig::new(HardwareAddress::Ip); iface_config.random_seed = rand::random(); - let mut iface = Interface::new(iface_config, &mut device); + let mut iface = Interface::new(iface_config, &mut device, SmolInstant::now()); iface.update_ip_addrs(|ip_addrs| { ip_addrs .push(IpCidr::new(IpAddress::v4(0, 0, 0, 1), 0))