Skip to content

networklayer: fix: an MLD Report leaves before the link-local address is tested - #1487

Open
levy wants to merge 16 commits into
masterfrom
topic/standards-tests-nd-gap9-fixes
Open

levy wants to merge 16 commits into
masterfrom
topic/standards-tests-nd-gap9-fixes

Conversation

@levy

@levy levy commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

On master, Rfc4862GroupsBeforeDad of tests/protocol/nd fails. It is the last ND test that fails, the half of gap 9 that #1392 left open. An IPv6 interface joins the solicited-node group of each tentative address before Duplicate Address Detection (RFC 4862 section 5.4.2), and its MLD Report for the group informs MLD-snooping switches. But the model held every MLD Report and Done until the link-local address was tested, so the Report left after the Neighbor Solicitation of the detection. RFC 3590 section 4 (MLDv1) and RFC 9777 section 5.2.14 (MLDv2) send such a message from the unspecified address. They also tell a node to report its groups again once the link-local address is valid, and tell a router to discard a Report or a Done from the unspecified address.

This changes only the simulations with MLD (hasMld = true, off by default): the MLD and PIM IPv6 examples. Their nodes send their first Reports at once, from the unspecified address, and report again from the link-local address once it is valid. The applications send and receive the same packets. No parameter is new, removed or changed.

The repair has three parts:

  • IPv6. Ipv6::fragmentPostRouting keeps the unspecified source of a local MLD Report or Done (ICMPv6 types 131, 132 and 143), next to the exception for the solicitation of DAD. MLD sets the source of each of these messages, so the IPv6 layer sends from the unspecified address only when MLD asks for it. A rule on an explicit :: source is not used, because a UDP socket bound to :: also gives one. A router also does not forward a multicast datagram from the unspecified address any more (RFC 4291 section 2.5.2). Without that rule, a PIM-DM router stopped at an assertion: it tried to forward an MLDv1 Report from ::, which goes to the address of its group.
  • The receivers. Mldv1 and Mldv2 discard a Report or a Done from the unspecified address, as a router and as a host (RFC 3590 sections 4 and 6, RFC9777-REP-37).
  • The senders. A Report or a Done leaves at once: from the link-local address when it is valid, else from the unspecified address. When the link-local address of such an interface becomes valid, MLDv1 sends a Report for each group, and MLDv2 sends one Current-State Report (RFC9777-REP-39). The held messages go.

The held messages hid four wrong premises in the tests, and each has its own commit before the commit that exposes it: TestMld injected messages with no source; MLDv2_router_basic and MLDv2_ssm joined before the hosts had a link-local address (hostBootupTime is 0.4 to 1 s); and two MLD checks asked more than RFC 9777. One check asked a link-local source for every message, and the other forbade an MLDv2 Report before the first MLDv1 Query. The checks and their tests now follow the RFC text. A new check and test, Rfc9777ReportBeforeLinkLocal, covers RFC9777-REP-34, REP-37 and REP-39, which were owed.

Commits, in the order to read them

The series follows PR-SPLIT-PREPARE: the change commits prepare the repair and move nothing, and each of the two fix commits in src turns on the new behavior for one MLD version, with 10 source lines. The tests commits change no model code. The plan and doc commits change no behavior.

  • f0ebcc4eea plan: add: ND gap 9, an MLD Report before the address is tested (the plan; it moves to plan/done/ in the last commit)
  • e0e3013087 doc: add: MLD check of a start of listening before the link-local address is tested (the check of RFC9777-REP-34, REP-37 and REP-39, from the standard text alone)
  • 7ebe3f2bfb ipv6: change: a local MLD Report or Done keeps the unspecified source address (moves nothing: MLD gives no message the unspecified source yet)
  • a5ebd06427 ipv6: change: a router does not forward a multicast datagram from the unspecified address (RFC 4291 section 2.5.2; moves nothing)
  • 699aae06bb tests: fix: the MLD module tests inject messages from a link-local address (prepares the receivers: TestMld sets the source fe80::99)
  • 0884b81727 icmpv6: change: an MLD node discards a Report or Done from the unspecified address (moves nothing: no node sends one yet)
  • 0963afe263 icmpv6: change: an MLD node reports its groups again when its link-local address becomes valid (moves nothing: no interface has sent from the unspecified address yet)
  • 5e36e5e1b6 icmpv6: fix: an MLDv1 Report leaves before the link-local address is tested (turns the new behavior on for MLDv1; Rfc4862GroupsBeforeDad passes, and the release note)
  • e3a215fd40 tests: fix: two MLD checks allow a Report before the link-local address is valid (prepares MLDv2: the checks and the tests of "Router Alert on every message" and "Listener in MLDv1 mode", corrected to RFC 9777)
  • 22f8efc1f6 tests: fix: two MLDv2 module tests join after the link-local address (prepares MLDv2: the receivers join at 1.5 s)
  • 5ff01865c2 icmpv6: fix: an MLDv2 Report leaves before the link-local address is tested (turns the new behavior on for MLDv2, with Rfc9777ReportBeforeLinkLocal)
  • 9adabaf61b icmpv6: change: MLD holds no message until the link-local address is valid (the clean-up: the held messages and the mldv1Mode parameter of cancelHostTimers go; moves nothing)
  • efc9302250 plan: change: ND gap 9 and the MLD Reports before the link-local address are repaired (the facts found on the way; the run records cite this commit)
  • b72c90da02 doc: change: ND and MLD results, coverage and conformance after the repair of gap 9 (ND 37 of 37 PASS, MLD 48 of 48 PASS, and the new counts of the RFC 9777 statements)
  • 1267f65ecf plan: change: the repair of ND gap 9 is done
  • 525f029e38 plan: location: move the ND gap 9 repair plan to done

Architectural surface:

  • Packet content: an MLD Report or Done leaves from the unspecified address while its interface has no valid link-local address, and a node sends more Reports once the address is valid. No message format changes.
  • Configuration surface: no parameter is new, removed or changed.
  • Contracts: Ipv6::fragmentPostRouting keeps the unspecified source of a local MLD Report or Done, and Ipv6::routeMulticastPacket drops a multicast datagram from the unspecified address. Mldv1 and Mldv2 lose heldMessages, sendHeldMessages and deleteHeldMessages, and get the protected virtual function sendReports; Mldv2 gets sendCurrentStateReport, and its cancelHostTimers loses the parameter mldv1Mode.
  • Tests of other suites: TestMld of tests/module/lib gives its messages a link-local source; MLDv2_router_basic and MLDv2_ssm start their receivers at 1.5 s. The MLD tests Rfc9777HopLimitAndSource and Rfc9777ListenerV1Mode and their checks follow RFC 9777.
  • No feature descriptor changes, no sealed path, and no new AV-* or NV-* row.

Baseline changes

The lists with a reason for each line are in the commits: the fingerprint list in the INET commit, the statistics list in the statistics commit that it pins (branch topic/standards-tests-nd-gap9-fixes of inet-framework/statistics, 2 commits on 76d45e4e, the statistics commit that master pins). No chart moves. Each commit has the form commit of TR-BASELINE-ATTRIBUTION: the repair commit is the small change.

  • icmpv6: fix: an MLDv1 Report leaves before the link-local address is tested
    3 fingerprint configurations and 3 statistical results move, the examples with MLDv1 (ipv6/mld MldDemo, pim dm_ipv6 and sm_ipv6): the nodes send their first Reports from the unspecified address and report again from the link-local address, so the MLD frames and their timing change. The nodes send more Ethernet frames (MldDemo 38 to 45, dm_ipv6 493 to 522, sm_ipv6 464 to 491), and the applications send and receive the same packets.
  • icmpv6: fix: an MLDv2 Report leaves before the link-local address is tested
    2 fingerprint configurations and 2 statistical results move, the examples with MLDv2 (ipv6/mld MldV2Ssm, pim ssm_ipv6): the nodes send their first Reports from the unspecified address and one Current-State Report from the link-local address. The nodes send more Ethernet frames (MldV2Ssm 48 to 52, ssm_ipv6 232 to 240), and the applications send and receive the same packets.

Evidence

The runs used a copy of the CI job: the image of ubuntu-26.04 with its clang (clang 21.1.8), OMNeT++ omnetpp-6.x at a2a6c68a91 (6.5.0) and opp_repl github_ci. In this image, master gives the same results as its CI. The debug runs are at efc9302250, the commit that the run records cite, and the release runs are at the tip; the src and tests trees of the two commits are the same.

Command Result
opp_run_protocol_tests -m debug -w '^tests/protocol/nd$' 37 tests, 37 PASS. Master: 36 PASS, 1 FAIL (Rfc4862GroupsBeforeDad)
opp_run_protocol_tests -m debug -w '^tests/protocol/mld$', and the same for igmp and ipsec MLD 48 PASS (one new test), IGMP 43 PASS, IPsec 28 PASS and its 3 expected FAIL
opp_run_protocol_tests -m debug 1197 tests: 846 PASS, 306 expected SKIP (the packetdrill tests need inet-gpl), 45 expected FAIL, no unexpected result
opp_run_module_tests -m debug 846 tests: 839 PASS, 7 FAIL or ERROR (ExternalProcess_1 to _4, AarfRateControl*, IPv4_dont_fragment_drop_reason), the same 7 as master in the same container
opp_run_fingerprint_tests -m release 1847 tests: 1846 PASS, 1 expected ERROR
opp_run_statistical_tests -m release, with the pinned statistics 945 tests: 934 PASS, 11 expected SKIP
opp_run_chart_tests -m release 236 tests: 225 PASS, 11 expected SKIP

Each commit got its fingerprint values and its statistics commit in the same image, at that commit, on master bfb149475b: the complete fingerprint test, and the 7 statistical tests of the MLD examples, against the values of the commit before. Only the two fix commits move results. A debug run of each commit (the ND and MLD suites, and the 16 MLD and PIM module tests) shows Rfc4862GroupsBeforeDad FAIL up to the MLDv1 commit and PASS from it on, and all other tests PASS at each commit. Rfc9777ReportBeforeLinkLocal fails at the parent of the MLDv2 commit, at its first guard (RFC9777-REP-34).

The series was then rebased onto master 1369a093f0. The new commits of master change only comments in src, the lan80211 example with its statistics, and one 802.11 protocol test, and no baseline file is common to them and this series. baseline_pins.py rebase made the commits again with no conflict and moved the two pins to the rebased statistics commits. The runs in the table are on this base.

Not verified here:

  • The feature tests, the validation tests and the attribution run. The CI of this pull request runs them.
  • A Query from the unspecified address is not discarded on receipt (RFC 3590 section 4). No test needs it, and this branch does not change it.
  • The Router Solicitation of ND still leaves from the preferred address, though RFC 4861 section 6.3.7 allows the unspecified address. No test needs it.

The plan, with the decisions and the facts found on the way, is plan/done/nd-gap9-mld-unspecified-source.md.

🤖 Generated with Claude Code


Devin Review

levy added 16 commits November 24, 2026 21:44
Before this commit, the second half of ND gap 9 was open: an MLD Report waits until the link-local address is tested, so it leaves after the Neighbor Solicitation of Duplicate Address Detection, and Rfc4862GroupsBeforeDad fails.

After this commit, a plan repairs it in MLDv1 and MLDv2, with the IPv6 layer and the receivers, and gives the MLD statements of the same case (RFC9777-REP-34, REP-37, REP-39) their check.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: plan | behavior.add | - | nd-gap9-mld-unspecified-source
…ress is tested

Before this commit, RFC9777-REP-37 to REP-39 had no check: the MLD checks named them work for a later level 2 pass, a node that reports before it has a link-local address.

After this commit, one check covers REP-34 for a Report before the link-local address is tested, REP-37 and REP-39. A host listens from the start, while its link-local address is tentative; its Report leaves from the unspecified address, the router takes no action on it, and once the detection ends the host reports again from its link-local address. A Query Response Interval of 1 second and a Robustness Variable of 1 at the host leave the new Report of REP-39 as the only Report from the link-local address before the second startup General Query.

REP-38, the listening state that the host keeps after the router discards its Report, is state inside a node and goes to that group of statements with no check.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: doc | behavior.add | - | nd-gap9-mld-unspecified-source
… address

Before this commit, fragmentPostRouting gave every local datagram from the unspecified address the preferred address of its interface, except a datagram to a solicited-node multicast address, the Neighbor Solicitation of Duplicate Address Detection. With a tentative preferred address, the datagram waited in pendingDadQueue until the detection ended. So MLD could not send a Report or a Done from the unspecified address, as RFC 3590 section 4 and RFC 9777 section 5.2.14 ask while the interface has no valid link-local address.

After this commit, an MLD Report or Done (ICMPv6 types 131, 132 and 143) from the unspecified address keeps it. MLD gives the source of every Report and Done: its link-local address when that address is valid. So the IPv6 layer sees an MLD message from the unspecified address only when MLD means it.

A rule by the kind of the requested source, an explicit IPv6 address :: against no address, is not used: a socket that is bound to :: requests an explicit :: too.

Nothing moves at this commit: MLD holds every Report and Done until the link-local address is valid, and sends it from that address.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.ipv6 | behavior.change | - | nd-gap9-mld-unspecified-source
… unspecified address

Before this commit, a multicast router looked up a route for every received multicast datagram of a scope above link-local, whatever its source. Without a route, it gave the source and the group to the multicast routing protocol, and PimDm::unroutableMulticastPacketArrived asserts that the source is specified.

After this commit, a router does not forward a multicast datagram from the unspecified address, as RFC 4291 section 2.5.2 says: "An IPv6 packet with a source address of unspecified must never be forwarded by an IPv6 router." The router still delivers the datagram locally when it belongs to the group or carries the Router Alert option. Such a datagram is an MLDv1 Report to the address of its group, which a node sends before it has a valid link-local address (RFC 3590 section 4).

Nothing moves at this commit: no node sends a multicast datagram of a larger scope than link-local from the unspecified address yet.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.ipv6 | behavior.change | - | nd-gap9-mld-unspecified-source
…dress

Before this commit, TestMld gave an injected MLD message a destination and no source, so the message came from the unspecified address. A Report from that address is one that a router discards (RFC 9777 section 5.2.14, RFC 3590 section 4), which the next commit makes the model do; then MLDv2_interop_router loses its Reports.

After this commit, every injected message comes from fe80::99, a link-local address of another node on the link, as every MLD message does (RFC 2710 section 3, RFC 9777 section 5).

Nothing moves at this commit: the model does not read the source of a received MLD message yet.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: tests.module | behavior.change.fix | - | nd-gap9-mld-unspecified-source
…ified address

Before this commit, an MLDv1 or MLDv2 node acted on every Report and Done, whatever its source. A router recorded a listener, and an MLDv1 host suppressed its own Report.

After this commit, a node silently discards a Report or a Done from the unspecified address, as a router (RFC 3590 section 4, RFC 9777 section 5.2.14) and as a host (RFC 3590 section 6). A node sends such a message before it has a valid link-local address, so a router cannot identify its sender. A Query from the unspecified address is not in this change.

Nothing moves at this commit: no node sends an MLD message from the unspecified address yet.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.icmpv6 | behavior.change | - | nd-gap9-mld-unspecified-source
…cal address becomes valid

Before this commit, MLD had no step for the moment at which a node that reported from the unspecified address gets a valid link-local address.

After this commit, an MLD node remembers the interfaces that sent a Report or a Done from the unspecified address. Once the link-local address of such an interface is valid, the node sends a new Report for each group that it listens to there, as RFC 3590 section 4 and RFC 9777 section 5.2.14 say that a node SHOULD. MLDv1 sends a Report for each group; MLDv2 sends one Current-State Report, the Report of a General Query, or in MLDv1 mode an MLDv1 Report for each group.

Nothing moves at this commit: MLD still holds every Report and Done until the link-local address is valid, so no interface sends from the unspecified address yet.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.icmpv6 | behavior.change | - | nd-gap9-mld-unspecified-source
…tested

Before this commit, an MLDv1 node held every Report and Done until Duplicate Address Detection had tested its link-local address (heldMessages), and then sent them from that address. So the Report for the solicited-node group of a tentative address left after the Neighbor Solicitation of the detection. RFC 4862 section 5.4.2 joins the group before the solicitation, and the Report informs MLD-snooping switches (the second half of ND gap 9).

After this commit, a Report or a Done leaves at once: from the link-local address when it is valid, else from the unspecified address (RFC 3590 section 4). Once the link-local address is valid, the node reports its groups again, and a router or a host discards a Report or a Done from the unspecified address; both steps came in earlier commits. Nothing fills the held messages any more, and a later commit removes them.

To see the defect, run Rfc4862GroupsBeforeDad of tests/protocol/nd on the parent commit: it fails at step 1, because no MLD Report of A names ff02::1:ff00:a before the solicitation for its link-local address.

Statistical results: 3 move too. The statistics commit "mld: update statistics after the MLDv1 Reports before the link-local address" holds the new values and the reason.

Baseline changes:
  fingerprint runs changed in tplx,~tND,~tNl (3; examples/pim 2, examples/ipv6 1) — the examples with MLDv1 (ipv6/mld MldDemo, pim
    dm_ipv6 and sm_ipv6): the nodes send their first Reports from the unspecified address at once,
    the routers discard them, and the nodes report again from their link-local addresses once those
    are valid, so the MLD messages and their timing change

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.icmpv6.Mldv1 | behavior.change.fix | test whatsnew fingerprint statistical | nd-gap9-mld-unspecified-source
…ss is valid

Before this commit, two MLD checks and their tests asked more than RFC 9777. "Router Alert on every message" (Rfc9777HopLimitAndSource) asked a link-local source for every MLD message, but RFC 9777 section 5 sends a Report from the unspecified address while the interface has no valid link-local address yet (RFC9777-REP-34). "Listener in MLDv1 mode" (Rfc9777ListenerV1Mode) forbade every Version 2 Report of A from the start, but RFC9777-COMPL-9 holds in the MLDv1 mode, which section 8.2.1 starts with the first MLDv1 Query that A receives. The model held such Reports until the link-local address was valid, and a change of the mode deleted the held MLDv2 Reports, so the strict checks passed. The next MLDv2 commit sends them.

After this commit, the first check allows a Report from the unspecified address before the first MLD message of its sender from the link-local address, and the second check forbids a Version 2 Report of A from the first MLDv1 Query that A receives.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: tests.protocol | behavior.change.fix | - | nd-gap9-mld-unspecified-source
Before this commit, MLDv2_router_basic and MLDv2_ssm let the receiver join at the start. Neighbor Discovery assigns the link-local address of a host after its boot-up time, up to 1 second (hostBootupTime). The model held the State-Change Reports of the join until then, and sent them from the link-local address, so the router logged the TO_EX and the ALLOW record that the tests check. With the next MLDv2 commit, they leave from the unspecified address, and the router discards them (RFC 9777 section 5.2.14).

After this commit, the receiver joins at 1.5 seconds, after it has its link-local address, so the router again receives the State-Change Report of the join.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: tests.module | behavior.change.fix | - | nd-gap9-mld-unspecified-source
…tested

Before this commit, an MLDv2 node held every Report until Duplicate Address Detection had tested its link-local address (heldMessages), and then sent it from that address. RFC 9777 section 5.2.14 sends a Report from the unspecified address while the interface has no valid link-local address, so that MLD-snooping switches learn the groups that Neighbor Discovery needs (RFC9777-REP-34).

After this commit, a Report leaves at once: from the link-local address when it is valid, else from the unspecified address. Once the link-local address is valid, the node sends one Current-State Report with all its groups (RFC9777-REP-39), and a router takes no action on a Report from the unspecified address (RFC9777-REP-37); both steps came in earlier commits. Nothing fills the held messages any more, and a later commit removes them.

The new test Rfc9777ReportBeforeLinkLocal of tests/protocol/mld checks the three statements, by the check "A start of listening before the link-local address is tested". To see the defect, run it on the parent commit: it fails at its first guard, because the first Report of A from its link-local address comes with no Report of A for G from the unspecified address before it.

Statistical results: 2 move too. The statistics commit "mld: update statistics after the MLDv2 Reports before the link-local address" holds the new values and the reason.

Baseline changes:
  fingerprint runs changed in tplx,~tND,~tNl (2; examples/ipv6 1, examples/pim 1) — the examples with MLDv2 (ipv6/mld MldV2Ssm, pim
    ssm_ipv6): the nodes send their first Reports from the unspecified address at once, the routers
    discard them, and the nodes send a Current-State Report from their link-local addresses once
    those are valid, so the MLD messages and their timing change

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.icmpv6.Mldv2 | behavior.change.fix | test whatsnew fingerprint statistical | nd-gap9-mld-unspecified-source
…valid

Before this commit, Mldv1 and Mldv2 kept the held messages (heldMessages, sendHeldMessages and deleteHeldMessages), and cancelHostTimers of Mldv2 deleted the held Reports of the old version on a change of the compatibility mode. Since the two commits before, a Report or a Done leaves from the unspecified address instead, so nothing filled them.

After this commit, the held messages go, with the parameter of cancelHostTimers that only selected the held Reports.

Nothing moves at this commit: it removes code that no message reaches.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: src.networklayer.icmpv6 | behavior.change | - | nd-gap9-mld-unspecified-source
…ess are repaired

Before this commit, the plan listed the steps of the repair as open.

After this commit, the plan marks the twelve commits of the repair as done, lists what each moves, and records the facts found on the way: the forwarding of a datagram from the unspecified address, the source of the injected messages and the join time of two module tests, two MLD checks that asked more than RFC 9777, and the measurement of each commit.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: plan | behavior.change | - | nd-gap9-mld-unspecified-source
…epair of gap 9

Before this commit, the ND documents named the second half of gap 9 open: Rfc4862GroupsBeforeDad failed, and RFC4862-DAD-11 and RFC4861-AR-4 had a failing core check. The MLD documents named RFC9777-REP-37 to REP-39 owed, and gap 2 said that a Report or a Done waits for the link-local address.

After this commit, they follow a fresh debug run at efc9302 in the image of the CI job: ND 37 tests, 37 PASS; MLD 48 tests, 48 PASS. results.md marks the second half of ND gap 9 repaired, with the commits of MLDv1 and MLDv2, and keeps the description of the old code. In the MLD ledger, REP-37 and REP-39 are selected by the new check and Rfc9777ReportBeforeLinkLocal, REP-34 has that test too, and REP-38 is state inside a node, level 4; 55 statements stay owed. No feature verdict changes: the features of the two ND rows stay partial for their owed statements.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: doc | behavior.change | - | nd-gap9-mld-unspecified-source
Before this commit, the plan had the documents and the gates open.

After this commit, the plan marks them done, with the results of the fresh run and of the gates. The statistics commits of the repair are on a local branch of the statistics repository only, as the branch is local.

Plan: plan/pending/nd-gap9-mld-unspecified-source.md
Change: plan | behavior.change | - | nd-gap9-mld-unspecified-source
Before this commit, the plan of the repair was in plan/pending.

After this commit, it is in plan/done, because all its steps are done.

Plan: plan/done/nd-gap9-mld-unspecified-source.md
Change: plan | location | - | nd-gap9-mld-unspecified-source

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 5 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant