mirror of
https://github.com/jmcorgan/fips.git
synced 2026-10-29 23:27:37 +00:00
Unplugging a USB cable ended the link in the transport within a millisecond (EIO on the accessory side, a dead device on the host side), but the node was never told: it kept the peer, tried a rekey over the dead link every second, and waited out link_dead_timeout_secs (30 s) before removing it. Myco showed the peer, and dialled it, for that long. The USB transport now records each link that ends on its own (not one the node closed, nor one a replug replaced), and `TransportHandle:: take_closed_links` hands them to the node's fast path tick, alongside the carrier edge it already polls for interface-bound transports. A peer with a live path elsewhere gets the closed path marked Suspect, so selection moves traffic off it in the same tick, and a PathClose; a peer whose only live path it was is removed through the same routine as the link-dead reap, and its reconnect scheduled as usual. Covered by `node::tests::usb::pulling_the_cable_removes_the_peer_at_once`: both ends drop the peer within a second of the cable going.