huge improvements to stack example

This commit is contained in:
soypat
2025-01-24 17:30:23 -03:00
parent f2ce6312d3
commit b40927ebcd
3 changed files with 37 additions and 22 deletions
+2 -2
View File
@@ -610,7 +610,7 @@ func (tfrm TCPFrame) CalculateIPv4CRC(ifrm IPv4Frame) uint16 {
ifrm.crcWriteTCPPseudo(&crc)
expectLen := int(ifrm.TotalLength()) - ifrm.HeaderLength()
if expectLen != len(tfrm.buf) {
println("unexpected TCP buffer length mismatches IPv4 header total length", expectLen, len(tfrm.buf))
println("unexpected TCP buffer length mismatches IPv4 header total length", len(tfrm.buf), expectLen)
}
tfrm.crcWrite(&crc)
return crc.Sum16()
@@ -622,7 +622,7 @@ func (tfrm TCPFrame) CalculateIPv6CRC(ifrm IPv6Frame) uint16 {
ifrm.crcWritePseudo(&crc)
expectLen := int(ifrm.PayloadLength())
if expectLen != len(tfrm.buf) {
println("unexpected TCP buffer length mismatches IPv4 header total length", expectLen, len(tfrm.buf))
println("unexpected TCP buffer length mismatches IPv4 header total length", len(tfrm.buf), expectLen)
}
tfrm.crcWrite(&crc)
return crc.Sum16()