mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-27 00:00:15 +00:00
* fix(peer_manager): route by destination rewritten in the nic packet pipeline NIC packet filters receive &mut ZCPacket and may rewrite the IP header (e.g. a NAT filter that maps a virtual peer address to an address on the local subnet). send_msg_by_ip parsed the destination before running the filter pipeline and then routed by that stale address, so rewritten packets were looked up by the pre-filter destination and dropped as unreachable. Re-parse the destination after run_nic_packet_process_pipeline and route by the rewritten address. Expose instance::packet_io as pub(crate) so peers can reuse the parser. * test(peer-manager): cover NIC destination rewrite routing Exercise IPv4 and IPv6 delivery through three peers connected by memory tunnels. A NIC filter rewrites the destination without setting a peer ID; verify delivery to the rewritten peer and no delivery to the original. Cover original destinations with and without an existing route. Wait for route convergence before sending each packet once, without data retries. Both regression tests fail with the PR routing fix removed and pass with it restored. All 37 peer-manager tests and formatting checks pass. Scoped Clippy completes with warnings in pre-existing code. --------- Co-authored-by: ldoubil <ldoubil@users.noreply.github.com> Co-authored-by: KKRainbow <5665404+KKRainbow@users.noreply.github.com>