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

[no sq.] Make client use second/fallback IP address from DNS #14200

Merged
merged 3 commits into from Jan 7, 2024

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Jan 1, 2024

For a problem description see this Wikipedia article but note I am not implementing what is written there.
Minetest will simply try the second address if it hasn't received any reply after 1.8s. This is invisible to the user.

tl;dr You can now host a dual-stack server without risking that a client will prefer IPv6, fail to connect and never try via IPv4 which would have worked fine.

To do

This PR is Ready for Review.

How to test

For one, go test the normal stuff like singleplayer or connecting to a remote server.

To test fallback:

  1. ensure you have ipv6 and your host prefers it
  2. Run ./bin/minetest --go --name test --address test14200.nekomimi.pw --verbose
  3. Observe nothing happening for ~2s, this is when it tries IPv6
  4. After that time you will receive an error because the IPv4 points to some random 0.4.x server I pulled from the list

@sfan5 sfan5 added @ Network Bugfix 🐛 PRs that fix a bug Feature ✨ PRs that add or enhance a feature labels Jan 1, 2024
@sfan5 sfan5 changed the title Make client use second/fallback IP address from DNS [no sq.] Make client use second/fallback IP address from DNS Jan 1, 2024
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempted to join a few old servers, followed by compatible ones. Works as expected. However, I did not notice that any fallback was needed during these tests. The code however looks good.

@sfan5 sfan5 merged commit 2c390b5 into minetest:master Jan 7, 2024
13 checks passed
@sfan5 sfan5 deleted the v4fallback branch January 7, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug Feature ✨ PRs that add or enhance a feature @ Network One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants