chore(ip-packet): print length of payload (#8913)

This is useful when debugging things.
This commit is contained in:
Thomas Eizinger
2025-04-28 20:45:15 +10:00
committed by GitHub
parent e0faddf43f
commit 52efb280ee

View File

@@ -159,7 +159,8 @@ impl std::fmt::Debug for IpPacket {
if let Some(tcp) = self.as_tcp() {
dbg.field("src_port", &tcp.source_port())
.field("dst_port", &tcp.destination_port())
.field("seq", &tcp.sequence_number());
.field("seq", &tcp.sequence_number())
.field("len", &tcp.payload().len());
if tcp.syn() {
dbg.field("syn", &true);
@@ -176,7 +177,8 @@ impl std::fmt::Debug for IpPacket {
if let Some(udp) = self.as_udp() {
dbg.field("src_port", &udp.source_port())
.field("dst_port", &udp.destination_port());
.field("dst_port", &udp.destination_port())
.field("len", &udp.payload().len());
}
match self.ecn() {