Skip to content

Remove preference for IPv4 when resolving target - #24

Merged
lance0 merged 2 commits into
lance0:masterfrom
n-thumann:dont_prefer_ipv4
Jan 25, 2026
Merged

lance0 merged 2 commits into
lance0:masterfrom
n-thumann:dont_prefer_ipv4

Conversation

@n-thumann

@n-thumann n-thumann commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor

This PR removes the preference for IPv4 when resolving target, but use whatever the OS resolver suggests.

I noticed that ttl has a preference for IPv4, unlike other tools like ping, traceroute, mtr etc. Instead, these tools use with what the resolver (getaddrinfo()) returns.
I think an application shouldn't make any assumptions about the users preference / violate the users preference configured in /etc/gai.conf, unless the user explicitly asks for it (e.g. with -4 / -6), see https://linux.die.net/man/3/getaddrinfo ("Normally, the application should try using the addresses in the order in which they are returned.").

I tested this change on Debian and macOS. On Debian, I additionally tested the compliance with /etc/gai.conf :)

@lance0 lance0 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this contribution! The change makes sense - aligning with standard Unix tools and respecting the OS resolver configuration is the right approach.

Good catch on the /etc/gai.conf compliance. We'll note this behavior change in the next release notes so users know to use -4 if they need to force IPv4.

Merging!

@lance0
lance0 merged commit cc4ad2b into lance0:master Jan 25, 2026
lance0 added a commit that referenced this pull request Jan 25, 2026
@n-thumann

Copy link
Copy Markdown
Contributor Author

Nice, thanks! 👏🏻

lance0 added a commit that referenced this pull request Jan 26, 2026
Release highlights:
- FreeBSD support (experimental)
- Fix target list lockup (#19)
- Fix hop detail modal truncation
- Resolver now follows OS order (PR #24)
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

Successfully merging this pull request may close these issues.

2 participants