Found while researching #842's duplicate-value question. LinkType(209).name returns the
name upstream explicitly says not to use, and pcapkit's own comment on that member says so
too.
Measured on origin/main (6216de505):
pcapkit/const/reg/linktype.py:421 #: [``DLT_IPMB_LINUX``] Legacy names (do not use) for Linux I2C below.
pcapkit/const/reg/linktype.py:422 IPMB_LINUX = 209
pcapkit/const/reg/linktype.py:424 #: [``DLT_I2C_LINUX``] Linux I2C packets.
pcapkit/const/reg/linktype.py:425 I2C_LINUX = 209
IPMB_LINUX is declared first, so it becomes the canonical member and I2C_LINUX an
alias of it. Live:
LinkType(209).name -> 'IPMB_LINUX'
LinkType['I2C_LINUX'] -> <LinkType.IPMB_LINUX: 209>
So even asking for the current name hands back the legacy one.
Upstream is unambiguous the other way. libpcap's pcap/dlt.h defines
#define DLT_I2C_LINUX 209 first, then explains: "This was renamed as it's also used for
other protocols, such as Display Data Channel as used by HDMI. We still define
DLT_IPMB_LINUX for backwards source compatibility." tcpdump.org/linktypes.html labels the
IPMB_LINUX row "Legacy names (do not use)". Wireshark drops the legacy name entirely —
epan/dissectors/packet-pcap_pktdata.c:174 has { 209, "I2C_LINUX" } only.
Cause is mechanical, and datable. The crawler reads linktypes.html row order
(pcapkit/vendor/reg/linktype.py:35) and has no alias or precedence logic. I2C_LINUX
landed first in 78ef9f7a89 (2024-04-27); a later regeneration, cfdf2ab5c7 (2024-05-04),
inserted IPMB_LINUX above it and silently flipped which name Python treats as
canonical. A regression introduced by regeneration, not by a hand edit.
Fix shape: the vendor module needs to emit the current name first when
linktypes.html lists a legacy row above it — or carry an explicit precedence override, since
row order demonstrably does not supply the answer. Regenerating without that change will
reintroduce it.
Separate from #842's register_alias design; this one is wrong regardless of which
convention wins there.
Found while researching #842's duplicate-value question.
LinkType(209).namereturns thename upstream explicitly says not to use, and pcapkit's own comment on that member says so
too.
Measured on
origin/main(6216de505):IPMB_LINUXis declared first, so it becomes the canonical member andI2C_LINUXanalias of it. Live:
So even asking for the current name hands back the legacy one.
Upstream is unambiguous the other way. libpcap's
pcap/dlt.hdefines#define DLT_I2C_LINUX 209first, then explains: "This was renamed as it's also used forother protocols, such as Display Data Channel as used by HDMI. We still define
DLT_IPMB_LINUX for backwards source compatibility."
tcpdump.org/linktypes.htmllabels theIPMB_LINUXrow "Legacy names (do not use)". Wireshark drops the legacy name entirely —epan/dissectors/packet-pcap_pktdata.c:174has{ 209, "I2C_LINUX" }only.Cause is mechanical, and datable. The crawler reads
linktypes.htmlrow order(
pcapkit/vendor/reg/linktype.py:35) and has no alias or precedence logic.I2C_LINUXlanded first in
78ef9f7a89(2024-04-27); a later regeneration,cfdf2ab5c7(2024-05-04),inserted
IPMB_LINUXabove it and silently flipped which name Python treats ascanonical. A regression introduced by regeneration, not by a hand edit.
Fix shape: the vendor module needs to emit the current name first when
linktypes.htmllists a legacy row above it — or carry an explicit precedence override, sincerow order demonstrably does not supply the answer. Regenerating without that change will
reintroduce it.
Separate from #842's
register_aliasdesign; this one is wrong regardless of whichconvention wins there.