You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When basic_host calls AllAddrs, it gets the mapping address from natmgr, and natmrg gets the mapping address from nat. However, nat does not determine the mapping failure, resulting in port 0 being returned.
Version Information
I found that my libp2p node's address list had a NATMap address with port 0 and an observed address with port 0.
At the same time, I found that my NAT mapping had the following error due to too many mapped addresses:
After debugging, I found that the problem is caused by:
When NAT mapping fails, port 0 will be returned
go-libp2p/p2p/net/nat/nat.go
Line 245 in 288868c
When basic_host calls AllAddrs, it gets the mapping address from natmgr, and natmrg gets the mapping address from nat. However, nat does not determine the mapping failure, resulting in port 0 being returned.
go-libp2p/p2p/host/basic/basic_host.go
Line 902 in 288868c
go-libp2p/p2p/host/basic/natmgr.go
Line 269 in 288868c
go-libp2p/p2p/net/nat/nat.go
Line 110 in 288868c
basic_host replaces the port observed by the observed address with 0
go-libp2p/p2p/host/basic/basic_host.go
Line 943 in 288868c
go-libp2p/p2p/host/basic/basic_host.go
Line 952 in 288868c
The text was updated successfully, but these errors were encountered: