From a59cefc498165469f1f22564c8f49e5840ae45ca Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 27 Sep 2023 05:57:09 +0800 Subject: [PATCH] log: fix missing inbound tag for datagram inbound --- leaf/src/app/nat_manager.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/leaf/src/app/nat_manager.rs b/leaf/src/app/nat_manager.rs index 46137250f..82e1e023a 100644 --- a/leaf/src/app/nat_manager.rs +++ b/leaf/src/app/nat_manager.rs @@ -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;