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

Wrong Use of Fallback IP(127.0.0.1) as fromIP in Ping message of Node Discovery Protocol #29713

Closed
learnerLj opened this issue May 6, 2024 · 1 comment
Labels

Comments

@learnerLj
Copy link

learnerLj commented May 6, 2024

Our tool finds that a client Geth/v1.14.0-stable-87246f3c/linux-amd64/go1.22.2 sends node discovery Ping message whose fromIP is 127.0.0.1. But the second Ping of it shows the correct public IP. I guess the it is the NAT or the setupPortMapping that trigger the problem.
image

@fjl
Copy link
Contributor

fjl commented May 7, 2024

The fromIp field in discv4 Ping is not widely used. go-ethereum sets it to the current best guess of the local node endpoint. If the node is unaware of its own endpoint, it puts 127.0.0.1 into this field. Local knowledge of the endpoint can change, for example when endpoint prediction behind NAT is in use. So that's why it will sometimes set to 127.0.0.1 and to another IP later.

@fjl fjl closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@fjl @learnerLj and others