Skip to content

EtherType: the 0x0000-0x05DC branch swallows Old Xerox 0x0101-0x01FF, so that range is unreachable #862

Description

@JarryShaw

pcapkit/const/reg/ethertype.py's _missing_ tests 0x0000 <= value <= 0x05DC (IEEE 802.3 Length Field) at :531 before 0x0101 <= value <= 0x01FF (Old Xerox Experimental) at :534. The second range is wholly contained in the first, so the Old Xerox branch at :534-537 is unreachable for every value it covers:

EtherType(0x0101).name  ->  'IEEE802_3_Length_Field_0x0101'   # expected Old_Xerox_...

Measured on main and confirmed unchanged by #861's cross-review, which found it while verifying that PR's Old Xerox conversion — that conversion is correct in source and simply never runs.

Same shape as #841 (IPX socket range ordering): the generated order follows the source table's row order, and a narrower range listed after a wider one is dead. The fix belongs in the generator, pcapkit/vendor/reg/ethertype.py, so a regeneration cannot undo it — but unlike #841 the range bounds are not literals in the crawler, so where the ordering is decided needs establishing first.

This is a real behaviour change (a code that resolves to one name today would resolve to another), so it wants its own PR rather than being folded into #861 or #775.

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 values

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions