-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
dns: getaddrinfo() differences between glibc and musl #2225
Comments
This would have to be a v2 thing, right? As a side note, if I'm remembering correctly, Node.js had a number of issues reported around using |
Maybe. glibc's default seems more useful than musl's. We'd have to think through the implications but I wouldn't dismiss outright the idea of making
Yes, although they weren't our bug, it was glibc's (and uclibc's, IIRC): nodejs/node#5436 (comment) |
I tend to agree. If we're going to set a default I would go for glibc's and tbh it seems more like a bug on our side not having the same behavior across platform, so I would vote for doing this in v1.x |
+1 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Additionally, the |
I would like to note, this musl libc6 difference seems to be problematic for busybox ntpd client, tends to end up failing to update time over IPv6.... |
The glibc behavior is explicitly wrong (contrary to spec):
Further, I think libuv must be doing something badly wrong in order to get the described behavior, since (musl's) |
getaddrinfo() without hints defaults to:
ai_flags = AI_ADDRCONFIG|AI_V4MAPPED
with glibc, andai_flags = 0
with musl libc.That means musl by default returns addresses that may be unreachable from the current machine whereas glibc won't.
And on the flip side, glibc will return IPv4-over-IPv6 addresses if no IPv6 address for that host exists whereas musl won't.
We should probably harmonize that one way or the other but what's the preferred behavior and why?
The text was updated successfully, but these errors were encountered: