Skip to content

Udp Packet #46

@dinodins

Description

@dinodins

Hi,
I have an issue reading pcap file, in udp pcaket, when there is the ip packet was fragments.
Hi have to modify the reading of the UdpProtocolo, in this way:

   private void _read() {
        this.srcPort = this._io.readU2be();
        this.dstPort = this._io.readU2be();
        this.length = this._io.readU2be();
        this.checksum = this._io.readU2be();
//        this.body = this._io.readBytes(length() - 8);
        if (this._io.size() != this.length) {
            this._io.seek(this._io.pos() - 8);
            this.body = this._io.readBytes(this._io.size());
        } else {
            this.body = this._io.readBytes((length() - 8));
        }
    }

can be correct this modification?

Simone

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions