Skip to content
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

Fallback to random output port on non-reusuable port is broken #6922

Closed
RubenKelevra opened this issue Feb 21, 2020 · 2 comments · Fixed by libp2p/go-reuseport-transport#22
Closed
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@RubenKelevra
Copy link
Contributor

Version information:

go-ipfs version: 0.4.23-6ce9a355f
Repo version: 7
System version: amd64/linux
Golang version: go1.13.7

Description:

The random port selection for outgoing connections doesn't seem to be working as a fallback if the port cannot be reused (or the debug output is wrong?):

Then the dials fail, because the port cannot be reused, and the log suggests, that the daemon tries to use a random port, but just uses the default port instead - which obviously fails:

Feb 21 22:03:16 i3 ipfs[14426]: 22:03:16.977 DEBUG reuseport-: failed to reuse port, dialing with a random port: dial tcp4 0.0.0.0:4001->172.x.x.x:4001: connect: cannot assign requested address reuseport.go:60

Found while digging to the debug code for #6921

@RubenKelevra RubenKelevra added the kind/bug A bug in existing code (including security flaws) label Feb 21, 2020
@Stebalien
Copy link
Member

That's... confusing. We log that before we try dialing again. The error is from the first (reuseport) dial, not the second.

Stebalien added a commit to libp2p/go-reuseport-transport that referenced this issue Feb 21, 2020
@Stebalien
Copy link
Member

libp2p/go-reuseport-transport#22

marten-seemann pushed a commit to libp2p/go-libp2p that referenced this issue Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants