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

ipfs p2p listen and foward should show actual port when listening on 0 #5523

Closed
hsanjuan opened this issue Sep 26, 2018 · 6 comments
Closed
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@hsanjuan
Copy link
Contributor

Version information:

master

Type:

Enhancement

Description:

ipfs p2p forward and ipfs p2p listen commands take a listen-address or a target address. It works with /ip4/127.0.0.1/tcp/0 but ipfs p2p ls does still show 0 instead of the actual port it bound to (which should be a random available one). This can only be discovered with lsof or similar (I think).

Ideally, p2p ls should list the bind-address with the actual port.

@overbool
Copy link
Contributor

https://github.com/ipfs/go-ipfs/blob/1e0d53fe3cb32be903d768495fd0526002a03c63/p2p/local.go#L109-L111

I think we should use:

func (l *localListener) ListenAddress() ma.Multiaddr {
	return l.listener.Multiaddr()
}

@Kubuxu Kubuxu added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up labels Sep 26, 2018
@magik6k magik6k added the help wanted Seeking public contribution on this issue label Sep 26, 2018
@Stebalien
Copy link
Member

We could also just set laddr to that address (and/or not even store it?). However, we need to make sure we can tell which forwarders were created with dynamic ports and which weren't (see: #5460 (comment)).

@overbool
Copy link
Contributor

@Stebalien Should target address in ipfs p2p listen accept 0 port? I don't think it makes sense here.

@Stebalien
Copy link
Member

I agree. We should prevent that.

overbool added a commit to overbool/go-ipfs that referenced this issue Sep 27, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
overbool added a commit to overbool/go-ipfs that referenced this issue Sep 27, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
@hsanjuan
Copy link
Contributor Author

Ah yes, for p2p listen it doesn't make sense. Only for listener local addresses.

overbool added a commit to overbool/go-ipfs that referenced this issue Sep 27, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
@hsanjuan
Copy link
Contributor Author

Also, launching two forward with a /tcp/0 shows listener already registered.

overbool added a commit to overbool/go-ipfs that referenced this issue Sep 29, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
overbool added a commit to overbool/go-ipfs that referenced this issue Sep 29, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
overbool added a commit to overbool/go-ipfs that referenced this issue Sep 29, 2018
;wq
Signed-off-by: Overbool <overbool.xu@gmail.com>

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
overbool added a commit to overbool/go-ipfs that referenced this issue Oct 5, 2018
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
overbool added a commit to overbool/go-ipfs that referenced this issue Oct 5, 2018
;wq
Signed-off-by: Overbool <overbool.xu@gmail.com>

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
Stebalien added a commit that referenced this issue Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

5 participants