fix(tun): loop back self-addressed packets for local delivery

A packet destined for our own mesh address reached the TUN reader on
macOS (utun egresses self-traffic into the daemon despite the lo0 host
route) and was pushed onto the mesh outbound path, where it was dropped
for lack of a session/route to self. Hairpin self-addressed packets back
to the TUN writer instead, so ping6 and connections to our own
<npub>.fips address are delivered locally.

On Linux the kernel already loops self-traffic via `lo` before it reaches
the TUN, so the branch never fires there; the check is kept unconditional
as a daemon-level delivery invariant and to keep it covered by Linux CI.
This commit is contained in:
Arjen
2026-06-17 14:32:17 +00:00
committed by Johnathan Corgan
parent 759f199518
commit 9a9e90a32c
2 changed files with 111 additions and 0 deletions
+8
View File
@@ -307,6 +307,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Packets addressed to a node's own mesh address are now delivered
locally instead of being dropped. On macOS the point-to-point `utun`
interface egresses self-addressed traffic into the daemon, which
previously pushed it onto the mesh outbound path where it was dropped
for lack of a route to self; such packets are now hairpinned back to
the TUN for inbound delivery, so `ping6` and connections to a node's
own `<npub>.fips` address work. Linux was unaffected (the kernel
already loops self-traffic via `lo`).
- The Tor transport now increments its `connect_refused` statistic (the
"Refused" line in fipstop) when a SOCKS5 connection is actively
refused, instead of recording every connect failure as a generic