-
Notifications
You must be signed in to change notification settings - Fork 177
Android: fix IPv6-only server connectivity #3045
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
base: master
Are you sure you want to change the base?
Conversation
062df2a to
d8224e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
ebdf2b0 to
df85703
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
- Fix native UDP socket family for IPv6 (Android) - Make address resolution robust on Android (IPv6 literals + getaddrinfo quirks) - Add Android-side DNS fallback for Private DNS resolver timeouts (udp/53) - Respect system address ordering and cache DNS results Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>
df85703 to
06f219e
Compare
|
Copilot Review suggestions applied, except hostname and port are two different fields and a TeamTalk server can be on a local network. |
|
Is there a way to avoid changing files in TeamTalk DLL? It appears strange that it works on all other platform than Android. Is it possible to make the DNS lookup in TeamTalkAndroid and always pass an IP-address (instead of a hostname) to TT_Connect()? |
|
I tried an Android-only approach (no changes in TeamTalk DLL / TeamTalkLib): resolve hostnames in DNS: Candidates for ipv6.hostname.tld -> [2001:xxxx:yyyy:zzzz::]
connect() to 2001:xxxx:yyyy:zzzz:: ... -> falseAnd even when entering the IPv6 literal directly: connect(): host=2001:xxxx:yyyy:zzzz:: candidates=[2001:xxxx:yyyy:zzzz::]
connect() ... -> falseSo this is not just a hostname/DNS issue. The Android native layer (JNI / underlying socket/connect path) appears to fail for IPv6, meaning an Android-only DNS workaround cannot fix #1987 on its own. I pushed a branch called Proposed compromise: |
Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>
|
I'll resolve the conflicts with master but I plan to put Should there also be a check on Android platform level? In other words does newer Android devices also have this issue? |
8ee4eff to
f4bd091
Compare
| // IPv6 literals may include a zone index, e.g. "fe80::1%wlan0". | ||
| std::string v6addr = host_utf8; | ||
| std::string v6scope; | ||
| auto percent = host_utf8.find('%'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v6addr and v6scope extraction could be simplified a lot by using a regular expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regex would add complexity and has known perf/portability issues on Android/NDK; I’d prefer the current simple split.
Yes, I’m using a Pixel 8a running Android 16, and I’m experiencing this issue. |
|
@beqabeqa473 are you ok with the changes in this PR? In the TeamTalk DLL I've isolated the Android code, so none of the other platforms are affected. |
Fixes #1987
Context
The Android client could not connect to an IPv6-only TeamTalk server. On some Android devices/networks, name resolution via
getaddrinfo()can also fail transiently (EAI_AGAIN), making connections unreliable even when IPv6 connectivity is available.What this changes
EAI_AGAIN, avoid problematicgetaddrinfo()flags/constraints, and handle numeric IPv4/IPv6 literals without relying on the platform resolver.DnsResolver(system ordering) and only fall back to UDP/53 DNS as a last resort (resolver timeouts/failures), with caching and logs limited to the fallback path.Compatibility / Risk
Testing