mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-07-22 21:00:38 +08:00
Connections routed to a selector (route target or final) enter through the ConnectionHandler path (NewConnection/NewPacketConnection), which never goes through Selector.DialContext/ListenPacket, so they were never registered in the interrupt group. As a result, SelectOutbound interrupted nothing and existing connections kept flowing over the previously selected outbound. Register the inbound connection in the interrupt group as an external connection on both handler branches, so switching the selected outbound interrupts routed connections when interrupt_exist_connections is enabled, while leaving them untouched by default. Fixes #4281.