Skip to content

reg: three Socket._missing_ range branches are unreachable, shadowed by a wider earlier branch #841

Description

@JarryShaw

Found while censusing the _missing_ range branches for #775. Pre-existing —
not introduced by #838.

Socket._missing_ tests its range branches in source order and returns on the
first match, so three branches can never be reached:

shadowed branch range shadowed by
pcapkit/const/ipx/socket.py:147 Experimental 0x0020-0x003F :144 Registered by Xerox, 0x0001-0x0BB8
:153 Dynamically Assigned Socket Numbers 0x4000-0x4FFF :150 Dynamically Assigned, 0x0BB9-0xFFFF
:156 Statically Assigned Socket Numbers 0x8000-0xFFFF :150, same

Measured on dd9eee846:

Socket(0x0030)  ->  'Registered by Xerox_0x0030'      # expected Experimental_0x0030

pcapkit/vendor/ipx/socket.py:240 already carries a comment noting the branches
are tested sequentially, but treats that as a description rather than a defect.

The root cause is in the vendor crawler, which emits the branches in IANA row
order rather than narrowest-range-first, so the fix belongs there and the const
file is regenerated from it. Worth checking whether any other registry with
overlapping published ranges has the same shape — this one was found by
inspection, not by a sweep.

Note the three shadowed names are also exactly the kind the #838 discussion is
about, so whichever way the mint/no-mint classification lands, these branches
need to be reachable before that classification means anything here.

Activity

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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)constRegenerated IANA or vendor constant tables; members keep their numeric valuesfixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions