You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ipv4): from_data does not round-trip the IPv4 header of http.pcap #1150
Describe the bug from_data does not round-trip the IPv4 header of examples/captures/http.pcap. Byte 33 reads 0x3c and rebuilds as 0x40, probably the total length or IHL. By contrast, ipv4.pcap and big_endian_nanosecond.pcap round-trip fully.
Reproduction
With #1147 applied, run Frame.from_data(frame.info, num=..., header=...) over http.pcap and compare the result with the original bytes.
Expected behavior
Every IPv4 header in the tracked captures round-trips byte for byte. Check options, padding and whether the total length is recomputed.
Additional context
Found by the #1126 worker. Not yet reproduced independently.
This is not an IPv4 bug. Byte 33 is the low byte of the IPv4 total length (16 + 14 + 3), which goes from 60 to 64. IPv4.make() computes it correctly as ihl*4 + len(payload). The payload TCP.from_data returns is 4 bytes too long because _make_tcp_options (tcp.py:2029-2116) drops the original NOPs and re-pads each option separately. Tracked in #1151.
A sweep of all 23 captures found no IPv4 field wrong once the TCP and HTTP payload faults are set aside.
Activity
JarryShaw commentedon Oct 6, 2026
This is not an IPv4 bug. Byte 33 is the low byte of the IPv4 total length (16 + 14 + 3), which goes from 60 to 64.
IPv4.make()computes it correctly asihl*4 + len(payload). The payloadTCP.from_datareturns is 4 bytes too long because_make_tcp_options(tcp.py:2029-2116) drops the original NOPs and re-pads each option separately. Tracked in #1151.A sweep of all 23 captures found no IPv4 field wrong once the TCP and HTTP payload faults are set aside.