-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tcp transport port_reuse_dialing test missing some assert #2651
Comments
Thanks for the bug report @Pj50. Great job catching this! This was my mistake. For others following along here is where the rust-libp2p/transports/tcp/src/lib.rs Line 327 in d21cd5f
Great! Let me know in case you need any help. |
Friendly ping @Pj50. Still interested in providing a patch? |
Sorry being late for a patch, I had to work on other topics last week. Working on it now. |
listen_addrs Sponsored by: Stormshield
Closing here with #2670 merged. |
Summary
The port_reuse_dialing test in transports/tcp/lib.rs seems to be incomplete, it does not check for port reuse.
Expected behaviour
In this test the dialer outgoing connection must reuse the listener port. So an assert like this should be added near line 930 in the port_reuse_dialing/dialer function:
Actual behaviour
The assert is missing and if I add it it fails. It seems to be a consequence of the commit 2ad905f. Previously the listen_addrs field in PortReuse was a Arc<RwLock<HashSet<(IpAddr, Port)>>> so it could be shared between GenTcpConfig and TcpListenStream. One ugly work around to make the assert pass in the test is to clone listener.port_reuse into tcp:
Possible Solution
Don't know if only the test is broken or if libp2p port reuse feature is also broken.
Would you like to work on fixing this bug?
Yes
The text was updated successfully, but these errors were encountered: