Skip to content

Commit

Permalink
[fix] tproxy: first packet got dropped by mistake
Browse files Browse the repository at this point in the history
Signed-off-by: Bearice Ren <[email protected]>
  • Loading branch information
bearice committed Sep 20, 2022
1 parent 679bb15 commit 90527b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/listeners/tproxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ impl TProxyListener {
.create_context(self.name.to_owned(), src)
.await;
let (tx, rx) = channel(100);
inner.sessions.insert(key, Session::new(src, tx)).await;
let mut session = Session::new(src, tx);
session
.add_frame(buf)
.await
.context("setup session failed")?;
inner.sessions.insert(key, session).await;
if self.udp_full_cone {
let r = TproxyReader::new(rx);
let w = TproxyWriter::new(src, inner.clone());
Expand Down

0 comments on commit 90527b2

Please sign in to comment.