Commit fa3979b
feat(mld): MLDv2 state-change robustness retransmit train (R4 P4b)
Adds the RFC 3810 §6.1 robustness retransmission of unsolicited MLDv2
state-change Reports — an unsolicited state-change is sent [Robustness
Variable] total times so the membership change survives the loss of up to
RV-1 packets, mirroring the shipped IGMPv3 retransmit train.
New on the ICMPv6 TX handler (the IPv6 analogue of the IGMP
'_igmp_state_change__pending' machinery):
- '_MldPendingChange' (the source-bearing §6.1 difference records to
re-send in MLDv2 mode, the reception-edge direction for the MLDv1 coarse
Report/Done fallback, and the remaining-repeat count) +
'_mld_state_change__pending' / '_mld_state_change__handle'.
- '_send_mld_state_change' now, after the immediate emission, seeds a
pending entry with RV-1 repeats and arms a retransmit ticket (a fresh
change supersedes any train pending for the same group).
- '_arm' schedules one ticket at random(1, mld.unsolicited_report_interval]
ms via 'stack.timer'; '_fire' re-emits under '_lock__multicast' in the
live compat mode (MLDv2 coalesces all pending groups into one Report,
MLDv1 emits the coarse form per group), decrements each entry, drops the
exhausted, and re-arms while any remain; '_cancel' drops the ticket +
clears the map on a compat-mode change (RFC 3810 §8.2.1), wired into the
RX 'ip_arm_v1_compatibility' MLDv2→MLDv1 transition (mirroring the v4
'_igmp_cancel_pending_timers' hook).
Three MLD policy sysctls back the train: 'mld.robustness' (RV, default 2),
'mld.unsolicited_report_interval' (default 1000 ms), and 'mld.query_interval'
(default 125 s). The on-touch migration folded the hardcoded
'MLD__ROBUSTNESS_VARIABLE' / 'MLD__QUERY_INTERVAL__MS' module locals out of
'packet_handler__icmp6__rx.py' into the sysctl-backed 'mld__constants',
read via qualified module access so an operator override resolves live —
removing the duplicate definition and completing the MLD constants file's
policy-knob migration.
Tests-first: three retransmit tests added to
'test__icmp6__mld__source_state_change.py' — the RV-1 retransmit carries
the same source-bearing record as the immediate Report, a RV of 2
schedules exactly one retransmit (exhaustion), and an inbound MLDv1 Query
cancels the pending train. The random spacing is patched to a fixed delay
and the FakeTimer advanced to fire the ticket.
Lint clean, 13537 passing, 0 skipped.
Reference: RFC 3810 §6.1 (state-change Report retransmitted RV-1 times).
Reference: RFC 3810 §9.1 (Robustness Variable).
Reference: RFC 3810 §8.2.1 (compat-mode change cancels pending retransmits).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e0f5de6 commit fa3979b
5 files changed
Lines changed: 358 additions & 32 deletions
File tree
- docs/refactor
- packages/pytcp/pytcp
- protocols/icmp6
- runtime/packet_handler
- tests/integration/protocols/icmp6
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
| |||
268 | 280 | | |
269 | 281 | | |
270 | 282 | | |
271 | | - | |
272 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
273 | 297 | | |
274 | 298 | | |
275 | 299 | | |
| |||
284 | 308 | | |
285 | 309 | | |
286 | 310 | | |
287 | | - | |
| 311 | + | |
288 | 312 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
294 | 318 | | |
295 | 319 | | |
296 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
42 | 60 | | |
43 | | - | |
| 61 | + | |
44 | 62 | | |
45 | 63 | | |
| 64 | + | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
| |||
54 | 73 | | |
55 | 74 | | |
56 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
| |||
1233 | 1226 | | |
1234 | 1227 | | |
1235 | 1228 | | |
1236 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1237 | 1232 | | |
| 1233 | + | |
1238 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| |||
Lines changed: 149 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
92 | 114 | | |
93 | 115 | | |
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
97 | 119 | | |
| 120 | + | |
| 121 | + | |
98 | 122 | | |
99 | 123 | | |
100 | 124 | | |
101 | 125 | | |
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
| 129 | + | |
| 130 | + | |
105 | 131 | | |
106 | 132 | | |
107 | 133 | | |
| |||
394 | 420 | | |
395 | 421 | | |
396 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
397 | 436 | | |
398 | 437 | | |
399 | 438 | | |
| |||
406 | 445 | | |
407 | 446 | | |
408 | 447 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
414 | 458 | | |
415 | 459 | | |
416 | 460 | | |
417 | 461 | | |
418 | 462 | | |
| 463 | + | |
419 | 464 | | |
420 | | - | |
421 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
422 | 473 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
427 | 506 | | |
428 | 507 | | |
429 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
430 | 567 | | |
431 | 568 | | |
432 | 569 | | |
| |||
0 commit comments