v1.0.6: Fix link establishment through boundary node

Bug fixes:
- Fix path_request_handler hops: use DestinationEntry._hops instead of
  stale cached announce_packet.hops(). The cached packet retains its
  original wire hops (pre-increment), but Python Transport.py explicitly
  overwrites packet.hops from path_table after retrieval (line 2736).
  This caused PATH_RESPONSE to report fewer hops than actual, making
  the sender's expected_hops too low, which caused LRPROOF hop-count
  validation to silently fail. (ROOT CAUSE of link timeout)

- Fix std::map::insert() no-op: erase before insert at 3 locations in
  _announce_table. Unlike Python dict assignment, C++ map::insert()
  does not overwrite existing keys. This prevented announce table
  updates from taking effect. (Caused PATH-RESP delivery failure)

- Defer packet hash filtering for link table entries and LRPROOF
  packets. Matching Python Transport behavior (line 1544), packets
  belonging to active links are not added to the filter hashlist
  until link transport processing determines it is our turn to
  forward them. Prevents premature filtering that breaks link transport.

- Pass DestinationEntry and LinkEntry by reference instead of by value
  to avoid stale copies and unnecessary allocations.

- Add link_table check before requesting paths for link_id destinations.
  Link data packets are handled by link transport, not standard path
  lookup, so spurious path requests are avoided.

- Add culling for _held_announces (60s timeout, cap 32) and
  _boundary_local_addresses to prevent unbounded memory growth.

- TcpInterface: detect and log partial writes.
This commit is contained in:
James L
2026-02-27 15:12:09 -05:00
parent 888e6ef313
commit 8184000d17
3 changed files with 148 additions and 51 deletions

View File

@@ -251,6 +251,8 @@ protected:
size_t written = _clients[i].client.write(frame_buf, flen);
if (written == 0) {
_cleanup_client(i, "write failed");
} else if (written < flen) {
Serial.printf("[TcpIF] PARTIAL write to client %d: %u/%u bytes\r\n", i, (unsigned)written, (unsigned)flen);
}
}
}