Skip to content

Commit

Permalink
Update netstack-lwip
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Jun 3, 2024
1 parent 69bb4a8 commit 250b910
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion leaf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ jni = "0.21"
# TUN
[target.'cfg(any(target_os = "ios", target_os = "android", target_os = "macos", target_os = "linux"))'.dependencies]
tun = { git = "https://github.com/eycorsican/rust-tun.git", branch = "fork", features = ["async"], optional = true }
netstack-lwip = { git = "https://github.com/eycorsican/netstack-lwip.git", rev = "9c7f2e3", optional = true }
netstack-lwip = { git = "https://github.com/eycorsican/netstack-lwip.git", rev = "9463bdf", optional = true }

[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies]
pnet_datalink = { version = "0.34", package = "pnet_datalink", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions leaf/src/proxy/tun/inbound.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::net::SocketAddr;
use std::pin::Pin;
use std::sync::Arc;

use anyhow::{anyhow, Result};
Expand All @@ -23,7 +24,7 @@ use crate::{
use super::netstack;

async fn handle_inbound_stream(
stream: netstack::TcpStream,
stream: Pin<Box<netstack::TcpStream>>,
local_addr: SocketAddr,
remote_addr: SocketAddr,
inbound_tag: String,
Expand Down Expand Up @@ -61,7 +62,7 @@ async fn handle_inbound_stream(
}

async fn handle_inbound_datagram(
socket: Box<netstack::UdpSocket>,
socket: Pin<Box<netstack::UdpSocket>>,
inbound_tag: String,
nat_manager: Arc<NatManager>,
fakedns: Arc<FakeDns>,
Expand Down
5 changes: 0 additions & 5 deletions leaf/src/proxy/vmess/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,10 @@ impl ShakeSizeParser {

pub trait PaddingLengthGenerator {
fn next_padding_len(&mut self) -> u16;
fn max_padding_len(&self) -> u16;
}

impl PaddingLengthGenerator for ShakeSizeParser {
fn next_padding_len(&mut self) -> u16 {
self.next() % 64
}

fn max_padding_len(&self) -> u16 {
64
}
}

0 comments on commit 250b910

Please sign in to comment.