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

nat: Use observed addresses if we have no mappings from nat manager #2357

Closed
sukunrt opened this issue Jun 12, 2023 · 1 comment
Closed

nat: Use observed addresses if we have no mappings from nat manager #2357

sukunrt opened this issue Jun 12, 2023 · 1 comment

Comments

@sukunrt
Copy link
Member

sukunrt commented Jun 12, 2023

If the user has selected libp2p.NATPortMap option, we attempt to do NAT port mapping using upnp and other protocols.
If we fail to detect the NAT or fail to do the port mapping our address inference logic via observed address field in identify completely fails.
What happens is that the check for natmgr here https://github.com/libp2p/go-libp2p/blob/master/p2p/host/basic/basic_host.go#L847 will be non nil and all calls to GetMapping will return nil.
To reproduce, run this in an ec2 instance with NatPortMap flag selected, or run this with a router where we are unable to do nat mapping.

This is a regression from v0.27. v0.27 did the right thing because it had this check https://github.com/libp2p/go-libp2p/blob/v0.27.0/p2p/host/basic/basic_host.go#L856

@sukunrt
Copy link
Member Author

sukunrt commented Jun 13, 2023

fixed by #2358

I'll open new issues for the edge cases that we can improve on. Those cases aren't regressions from v0.27, so I'm closing this.

@sukunrt sukunrt closed this as completed Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant