Skip to content

fix(toolkit): the pypcapfile engine's TCP payload includes the frame's Ethernet padding #1577

Closed

Description

@JarryShaw

With engine='pypcapfile', a TCP segment's payload includes the Ethernet padding after the IP datagram.

Repro on main (cc084357f), Python 3.11, pypcapfile 0.12.0. The capture holds a 1-octet TCP segment (b'x') padded to a 60-octet Ethernet frame. Reassembly gives b'x' on the default engine and b'x\x00\x00\x00\x00\x00' on pypcapfile.

Cause: pcapkit/toolkit/pypcapfile.py takes the TCP payload to the end of the frame, not to the end of the IPv4 Total Length.

Expected: the payload stops at the IP datagram's length, so the reassembled bytes match the default engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions