Skip to content

PCAP-NG: [pack_flags] option must be in Packet Block, but found in 168627466 block. #269

@dnesting

Description

@dnesting

Wireshark-generated PCAP-NG files cannot be parsed.

  • OS Version: MacOS Sequoia 15.4.1 (24E263)
  • Python Version: Python 3.12.2 (main, Feb 23 2024, 13:29:13) [Clang 15.0.0 (clang-1500.1.0.2.5)]
  • pypcapkit: 1.3.5.post16
  • Wireshark: Version 4.4.6 (v4.4.6-0-gaebb20483889)
from pcapkit import IP, extract

extraction = extract(fin="in.pcapng", nofile=True)
frame0 = extraction.frame[0]
# check if IP (IPv4 or IPv6) in this frame
if IP in frame0:
    # fetch the IP packet from this frame
    ip = frame0[IP]
    print(ip)

Output:

[CRITICAL] 05/11/2025 11:06:11 AM - ProtocolError: PCAP-NG: [pack_flags] option must be in Packet Block, but found in 168627466 block.
pcapkit.utilities.exceptions.ProtocolError: PCAP-NG: [pack_flags] option must be in Packet Block, but found in 168627466 block.

This happens with all PCAP-NG files I try, but here's a simple test case file:

in.pcapng.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions