rust-libp2p
rust-libp2p copied to clipboard
fix(quic): Improve Listener Socket Selection when Dialing
Description
Implementation now mirrors the TCP transport's approach by maintaining a centralized registry of listening addresses. When dialing, the transport queries this registry to find a suitable listener socket that matches the destination's IP version and loopback status.
Related: #4259
Notes & open questions
It could be optimized further, where we could query the OS routing table to determine the optimal source IP for reaching a destination, then find a listener bound to that IP. This provides the most accurate routing decisions because the OS kernel knows all routes, VPNs, policies, etc.
Change checklist
- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] A changelog entry has been made in the appropriate crates