Error recovery fixes and routing error rate limiting

- PathBroken handler: convert to async, trigger re-discovery via
  maybe_initiate_lookup(), reset COORDS_PRESENT warmup counter
  (was a stub that only invalidated coord_cache)

- CoordsRequired recovery timing: reset warmup counter in
  handle_lookup_response() when discovery completes for an
  established session, so COORDS_PRESENT packets fire after
  fresh coords are available (not just on CoordsRequired receipt)

- Routing error rate limiting: add RoutingErrorRateLimiter
  (100ms per-destination, matching ICMP PTB pattern) to gate
  send_routing_error() at transit nodes

- Remove root refresh dead code: the 1800s periodic root
  re-announcement in check_tree_state() only propagated to
  depth 1 (sequence-only changes don't cascade). Root loss
  detection relies on link failure propagation which works
  correctly.
This commit is contained in:
Johnathan Corgan
2026-02-17 00:00:04 +00:00
parent 8ca9db7480
commit 3ca2f9500a
8 changed files with 190 additions and 50 deletions
-5
View File
@@ -170,9 +170,6 @@ impl DiscoveryConfig {
/// Spanning tree (`node.tree.*`).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TreeConfig {
/// Root self-announcement interval in seconds (`node.tree.root_refresh_secs`).
#[serde(default = "TreeConfig::default_root_refresh_secs")]
pub root_refresh_secs: u64,
/// Per-peer TreeAnnounce rate limit in ms (`node.tree.announce_min_interval_ms`).
#[serde(default = "TreeConfig::default_announce_min_interval_ms")]
pub announce_min_interval_ms: u64,
@@ -184,7 +181,6 @@ pub struct TreeConfig {
impl Default for TreeConfig {
fn default() -> Self {
Self {
root_refresh_secs: 1800,
announce_min_interval_ms: 500,
parent_switch_threshold: 1,
}
@@ -192,7 +188,6 @@ impl Default for TreeConfig {
}
impl TreeConfig {
fn default_root_refresh_secs() -> u64 { 1800 }
fn default_announce_min_interval_ms() -> u64 { 500 }
fn default_parent_switch_threshold() -> usize { 1 }
}