Skip to content

Commit

Permalink
log: fix missing inbound tag for datagram inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Sep 26, 2023
1 parent 295a41e commit a59cefc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leaf/src/app/nat_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,16 @@ impl NatManager {
return;
}

let sess = sess.cloned().unwrap_or(Session {
let mut sess = sess.cloned().unwrap_or(Session {
network: Network::Udp,
source: dgram_src.address,
destination: pkt.dst_addr.clone(),
inbound_tag: inbound_tag.to_string(),
..Default::default()
});
if sess.inbound_tag.is_empty() {
sess.inbound_tag = inbound_tag.to_string();
}

self.add_session(sess, dgram_src.clone(), client_ch_tx.clone(), &mut guard)
.await;
Expand Down

0 comments on commit a59cefc

Please sign in to comment.