chore(connlib): improve wire::dev logging (#8272)

This will log more details about the packet, such as SYN, RST and FIN
flags for TCP.
This commit is contained in:
Thomas Eizinger
2025-02-26 17:26:10 +11:00
committed by GitHub
parent 2fe5c00c64
commit 4de0fb7640
2 changed files with 10 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ impl Device {
tracing::warn!("Packet matches heuristics of FZ-internal p2p control protocol");
}
tracing::trace!(target: "wire::dev::recv", dst = %packet.destination(), src = %packet.source(), bytes = %packet.packet().len());
tracing::trace!(target: "wire::dev::recv", ?packet);
}
Poll::Ready(n)
@@ -77,7 +77,7 @@ impl Device {
}
}
tracing::trace!(target: "wire::dev::send", dst = %packet.destination(), src = %packet.source(), bytes = %packet.packet().len());
tracing::trace!(target: "wire::dev::send", ?packet);
debug_assert!(
!packet.is_fz_p2p_control(),

View File

@@ -168,6 +168,14 @@ impl std::fmt::Debug for IpPacket {
if tcp.syn() {
dbg.field("syn", &true);
}
if tcp.rst() {
dbg.field("rst", &true);
}
if tcp.fin() {
dbg.field("fin", &true);
}
}
if let Some(udp) = self.as_udp() {