You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(protocols): every versioned family base dispatches on read and make (IGMP, IP, ICMP, L2TP, LinuxSLL) #2574
Standing convention from the owner on #2544: on a versioned protocol family, the base class is a dispatcher on both the read and the make path. Parsing bytes through the base, or building through it (constructor or make), yields the matching member, never a base-class layer. #2544 applies it to HTTP (HTTPv1/HTTPv2) and writes it onto protocol-family-grouping.rst.
Families to bring into line, those protocol-family-grouping.rst lists with versioned members:
IGMP (IGMPv1–3). Its base is abstract today and dispatches only from Internet._import_next_layer.
IP (IPv4/IPv6).
ICMP (ICMPv4/ICMPv6).
L2TP (L2TPv2).
LinuxSLL (LinuxSLL1/2).
For each, check what the base does now on direct construction from bytes and from fields. Make both paths yield the member, mirroring #2544's mechanism, and keep byte-exact round trips. Then test each family, and show the tests fail before the change.
Blocked: this mirrors #2544's mechanism and edits files #2542 (IGMP), #2527 (LinuxSLL) and #2544 change. It unblocks when #2544 merges; IGMP and LinuxSLL also need #2542 and #2527 merged first.
#2544 has merged. The family rollout still touches IGMP, whose names #2558 is changing, and LinuxSLL, which #2587 edits. Blocked: this unblocks when #2587 and #2558's PR merge.
Question for the rollout: does the SSL family (SSLv2, TLS, DTLS) count as a versioned family under the read-and-make dispatch rule?
No, leave it out (recommended). One TLS class already reads every TLS version, with a fixed id() and the version in its alias, and SSLv3 is a thin subclass. SSLv2 is a separate class that TLS reaches through its fallback, and SSL defines no read(). A dispatching SSL base would add a third path without fixing anything observable.
#2587 and #2590 have merged. The final #2490 member-order reorder is now in progress, and it reorders IPv4 and IGMPv3, two of the family classes this rollout changes. Blocked: this unblocks when #2490's reorder PR merges, so that the dispatch change lands on the reordered classes rather than rebasing across them. The SSL-family question above is still open for the owner.
#2613 (the final member-order reorder) has merged, so this is unblocked. A worker is rolling read-and-make dispatch out to IGMP, IP, ICMP, L2TP and LinuxSLL, mirroring #2544's HTTP mechanism, one commit per family. It leaves SSL out, as recommended above, unless you say otherwise.
The family dispatch is done locally, one commit per family, and the Sonnet review says GOOD TO GO. Through the base, IGMP, IP and L2TP now yield their member from octets, fields and from_data. ICMP and LinuxSLL do it from fields and from_data. A subclass is constructed as itself. The transport path's output and the registries match main exactly. It opens as a PR once the Actions queue drops below 20.
Needs deciding:
Octets with no version field. For ICMP and LinuxSLL, the IP protocol number or the link type is what names the member. (a) Refuse the octets through the base with ProtocolError, as HTTP refuses octets neither version takes. (b) Use the default member, which mislabels ICMPv6 and SLL2 octets. (c) Add a version= keyword. Recommend (a), and add (c) only if a caller needs it.
Field dispatch reads names only. So IP(src='::1', dst='::2') picks IPv4 and then fails. (a) Keep it names-only. (b) Also read what a shared field's value names: the address family, or the enum class of type. Recommend (b), as a follow-up.
Default members. The lowest version wins: IPv4, ICMPv4, L2TPv2, LinuxSLL1, and IGMPv1 for IGMP's defaults, mirroring HTTPv1. Recommend keeping them.
The PR goes up implementing 1(a) and 3. If you choose otherwise, the PR changes before it merges.
The owner refined answer 2, paraphrased: version= is the source of truth and the only check made. Construction does not select a member from fields that only one member takes.
Fields:version= alone picks the member, and fields without version= raise.
Octets:version= decides when it is given. Otherwise IGMP, IP and L2TP dispatch by the version their octets carry, and ICMP and LinuxSLL octets without version= raise.
The rework is done locally (wf/2574-r3, one commit per family, on fa9af520f), and a Sonnet review is running.
Picking the member:version= alone picks it. Fields without version= raise, even when a field only one member takes is passed. There is no default member.
Raw octets: IP, IGMP and L2TP still parse by the version their octets carry. ICMP and LinuxSLL raise without version=.
Choices you may want to veto:
Building a member with another member's version, e.g. IPv4(version=6), raises, and so does a bool version.
LinuxSLL's from_data now goes by data-model class, as ICMP's does.
IGMP's from_data still reads values, because IGMPv1 and IGMPv2 share one data model with no version field.
A version= that contradicts the octets fails in that member's own parser. For IP(v6 octets, version=4) the message is a schema padding error rather than a version error.
Owner ruling, paraphrased: IGMP's data model gains a version attribute that names its member. IGMP.from_data then dispatches on that attribute, as IP and L2TP read their data's version, rather than reading type, max_resp_time or the length. This resolves the one exception noted above. The IGMP commit is being reworked; wire bytes and protochains stay unchanged, and info gains a version key.
Activity
refactor(application)!: dispatch the HTTP base on read and make (#2544)
JarryShaw commentedon Nov 1, 2026
#2544 has merged. The family rollout still touches IGMP, whose names #2558 is changing, and LinuxSLL, which #2587 edits. Blocked: this unblocks when #2587 and #2558's PR merge.
JarryShaw commentedon Nov 1, 2026
Question for the rollout: does the SSL family (SSLv2, TLS, DTLS) count as a versioned family under the read-and-make dispatch rule?
TLSclass already reads every TLS version, with a fixedid()and the version in its alias, and SSLv3 is a thin subclass. SSLv2 is a separate class that TLS reaches through its fallback, andSSLdefines noread(). A dispatchingSSLbase would add a third path without fixing anything observable.SSL(...)would dispatch to SSLv2, TLS or DTLS on read and make, as the HTTP base does.fix(link): honour a stop at LinuxSLL on its ARPHRD registry path #2587 has merged. This rollout stays blocked until fix(internet): give IGMPv2 and IGMPv3 versioned names #2590 (the IGMP names) merges, so the answer can arrive any time before then.
JarryShaw commentedon Nov 2, 2026
#2587 and #2590 have merged. The final #2490 member-order reorder is now in progress, and it reorders IPv4 and IGMPv3, two of the family classes this rollout changes. Blocked: this unblocks when #2490's reorder PR merges, so that the dispatch change lands on the reordered classes rather than rebasing across them. The SSL-family question above is still open for the owner.
JarryShaw commentedon Nov 2, 2026
#2613 (the final member-order reorder) has merged, so this is unblocked. A worker is rolling read-and-make dispatch out to IGMP, IP, ICMP, L2TP and LinuxSLL, mirroring #2544's HTTP mechanism, one commit per family. It leaves SSL out, as recommended above, unless you say otherwise.
JarryShaw commentedon Nov 2, 2026
The family dispatch is done locally, one commit per family, and the Sonnet review says GOOD TO GO. Through the base, IGMP, IP and L2TP now yield their member from octets, fields and
from_data. ICMP and LinuxSLL do it from fields andfrom_data. A subclass is constructed as itself. The transport path's output and the registries matchmainexactly. It opens as a PR once the Actions queue drops below 20.Needs deciding:
ProtocolError, as HTTP refuses octets neither version takes. (b) Use the default member, which mislabels ICMPv6 and SLL2 octets. (c) Add aversion=keyword. Recommend (a), and add (c) only if a caller needs it.IP(src='::1', dst='::2')picks IPv4 and then fails. (a) Keep it names-only. (b) Also read what a shared field's value names: the address family, or the enum class oftype. Recommend (b), as a follow-up.The PR goes up implementing 1(a) and 3. If you choose otherwise, the PR changes before it merges.
4 remaining items
JarryShaw commentedon Nov 2, 2026
and I think
version=should be the source of truth and the only check to do. no need to check for version-only parameters.JarryShaw commentedon Nov 2, 2026
The owner refined answer 2, paraphrased:
version=is the source of truth and the only check made. Construction does not select a member from fields that only one member takes.version=alone picks the member, and fields withoutversion=raise.version=decides when it is given. Otherwise IGMP, IP and L2TP dispatch by the version their octets carry, and ICMP and LinuxSLL octets withoutversion=raise.from_data: unchanged.The rework in progress has been updated to match.
JarryShaw commentedon Nov 2, 2026
The rework is done locally (
wf/2574-r3, one commit per family, onfa9af520f), and a Sonnet review is running.version=alone picks it. Fields withoutversion=raise, even when a field only one member takes is passed. There is no default member.version=.version, e.g.IPv4(version=6), raises, and so does aboolversion.from_datanow goes by data-model class, as ICMP's does.from_datastill reads values, because IGMPv1 and IGMPv2 share one data model with no version field.version=that contradicts the octets fails in that member's own parser. ForIP(v6 octets, version=4)the message is a schema padding error rather than a version error.JarryShaw commentedon Nov 2, 2026
for IGMP, let's add a version attribute to their data model so to distinguish.
JarryShaw commentedon Nov 2, 2026
Owner ruling, paraphrased: IGMP's data model gains a
versionattribute that names its member.IGMP.from_datathen dispatches on that attribute, as IP and L2TP read their data's version, rather than readingtype,max_resp_timeor the length. This resolves the one exception noted above. The IGMP commit is being reworked; wire bytes and protochains stay unchanged, andinfogains aversionkey.refactor(internet): dispatch the IGMP base on read, make and from_data (
refactor(internet): dispatch the IP base on read, make and from_data (#…
refactor(internet): dispatch the ICMP base on read, make and from_data (
refactor(link): dispatch the L2TP base on read, make and from_data (#…
refactor(link): dispatch the LinuxSLL base on read, make and from_data (
docs(conventions): list each family base's dispatch in Dispatching Ba…