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

Fix an issue with ipv6 struct in6_addr that is not the same in Glibc and Musl #34

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

vliegeois
Copy link
Contributor

Pull request to fix issue #31

The issue is due to differences between Glibc and Musl.
For static cross-compilation for linux, Apple use Musl instead of Glibc https://www.swift.org/documentation/articles/static-linux-getting-started.html

So, the code for linux in PTR.swift and DNSClient+Query.swift should in fact be different for Glibc and Musl using
#if canImport(Glibc)
...
#elseif canImport(Musl)
...
#else

Then, the issue is related to differences in header netinet/in.h related to ipv6.
Here are the links to both headers
https://github.com/lattera/glibc/blob/master/inet/netinet/in.h
https://github.com/cloudius-systems/musl/blob/master/include/netinet/in.h

By looking to the differences in the struct in6_addr, I was able to propose this fix.

Regards

Vincent

@Joannis Joannis merged commit bf5b91a into orlandos-nl:master Feb 6, 2025
0 of 6 checks passed
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