chore(connlib): improve error messages for failed translations (#7540)

This commit is contained in:
Thomas Eizinger
2024-12-18 05:47:26 +01:00
committed by GitHub
parent 40ff26ce1a
commit 62dfe65679
2 changed files with 6 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ impl GatewayState {
let packet = peer
.translate_inbound(packet, now)
.context("Failed to translate packet")?;
.context("Failed to translate inbound packet")?;
let Some(encrypted_packet) = self
.node
@@ -156,7 +156,7 @@ impl GatewayState {
let packet = peer
.translate_outbound(packet, now)
.context("Failed to translate packet")?;
.context("Failed to translate outbound packet")?;
Ok(Some(packet))
}

View File

@@ -337,7 +337,7 @@ impl ClientOnGateway {
let mut packet = packet
.translate_destination(self.ipv4, self.ipv6, source_protocol, real_ip)
.context("Failed to translate packet")?;
.context("Failed to translate packet to new destination")?;
packet.update_checksum();
Ok(packet)
@@ -375,7 +375,9 @@ impl ClientOnGateway {
TranslateIncomingResult::NoNatSession => return Ok(packet),
};
let mut packet = packet.translate_source(self.ipv4, self.ipv6, proto, ip)?;
let mut packet = packet
.translate_source(self.ipv4, self.ipv6, proto, ip)
.context("Failed to translate packet to new source")?;
packet.update_checksum();
Ok(packet)