Skip to content

pcapng: Name Resolution Block guards report the systemd Journal Export Block #1038

Closed

Description

@JarryShaw

Name Resolution Block guards in pcapkit/protocols/misc/pcapng.py raise messages that name the wrong block. Seven sites check one block type and tell the caller about another.

The six ProtocolErrors at :3031, :3057 and :3085 (the read side) and :5140, :5171 and :5202 (the make side) all have this shape:

if self._type != Enum_BlockType.Name_Resolution_Block:
    raise ProtocolError(f'PCAP-NG: [ns_dnsname] option must be in :manpage:`systemd(1)` Journal Export Block, '
                        f'but found in {self._type} block.')

The guard checks Name_Resolution_Block, but the message says "systemd(1) Journal Export Block". The ns_dns* options belong to the NRB. RegistryWarning at :966 has the same problem: register_record warns "systemd(1) journal export record already registered" for what is a nrb_record_* Name Resolution record.

Two side issues: these are runtime strings, so the embedded :manpage: reST role reaches the user as literal text. Two of the six sites also spell the option ns_dnsip4addr/ns_dnsip6addr where the others use ns_dnsIP4addr/ns_dnsIP6addr.

Fix: name the Name Resolution Block (and record) in all seven messages, and drop the reST role from them. Add a test that triggers one read-side guard and one make-side guard and asserts the block named in the message.

Blocked on #1037, an open docstring-only PR (#719 sweep) on the same file. This change waits until #1037 merges or closes, to avoid a conflict. Found while reviewing #1037.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    fixPull requests that fix a defect (fix: subject prefix)
    and removed
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    on Oct 5, 2026
  2. JarryShaw commented on Oct 5, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1037 merged. A worker is on the fix now.

  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 5, 2026
  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 5, 2026
  5. added this to the 1.5 milestone on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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