kaitoy / pcap4j

A Java library for capturing, crafting, and sending packets.

Home Page:https://www.pcap4j.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad payload from IpV6ExtHopByHopOptionsPacket [1.8.2]

tkunovsky opened this issue · comments

Bug description

Payload which is returned from IpV6ExtHopByHopOptionsPacket is incorrect because it's shifted by 2 B. Tested on version 1.8.2.

Repro steps

  1. Unzip pcap from reprostep.zip

  2. Decode it

Current result:

Decoded as ICMPv6, Type: 1 (Destination Unreachable), Code: 0 (no route to destination)

Expected result:

Decoded as ICMPv6, Type: 143, Code: 0

How to fix it

For computation of the payload use hdrExtLen attribute.

Workaround

Compute payload yourself with methods getHdrExtLenAsInt() and getRawData().

Notes

Wireshark 3.4.2 can decode it without problems.