-
-
Notifications
You must be signed in to change notification settings - Fork 36
reg: three Socket._missing_ range branches are unreachable, shadowed by a wider earlier branch #841
Copy link
Copy link
Closed
Labels
bugIssues reporting a defect (set by the bug report template; a default, not an assessment)Issues reporting a defect (set by the bug report template; a default, not an assessment)constRegenerated IANA or vendor constant tables; members keep their numeric valuesRegenerated IANA or vendor constant tables; members keep their numeric valuesfixPull requests that fix a defect (fix: subject prefix)Pull requests that fix a defect (fix: subject prefix)
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
bugIssues reporting a defect (set by the bug report template; a default, not an assessment)Issues reporting a defect (set by the bug report template; a default, not an assessment)constRegenerated IANA or vendor constant tables; members keep their numeric valuesRegenerated IANA or vendor constant tables; members keep their numeric valuesfixPull requests that fix a defect (fix: subject prefix)Pull requests that fix a defect (fix: subject prefix)
Projects
- StatusShow more project fieldsDone
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 thefirst match, so three branches can never be reached:
pcapkit/const/ipx/socket.py:147Experimental0x0020-0x003F:144Registered by Xerox,0x0001-0x0BB8:153Dynamically Assigned Socket Numbers0x4000-0x4FFF:150Dynamically Assigned,0x0BB9-0xFFFF:156Statically Assigned Socket Numbers0x8000-0xFFFF:150, sameMeasured on
dd9eee846:pcapkit/vendor/ipx/socket.py:240already carries a comment noting the branchesare 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.