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

Envoy-mobile clients fail to speak IPV6 on Android clients with ndk >=24 #25326

Closed
RenjieTang opened this issue Feb 2, 2023 · 2 comments · Fixed by #25414
Closed

Envoy-mobile clients fail to speak IPV6 on Android clients with ndk >=24 #25326

RenjieTang opened this issue Feb 2, 2023 · 2 comments · Fixed by #25414

Comments

@RenjieTang
Copy link
Contributor

Currently the posix version of getifaddrs() has 2 paths:
For Android with ndk version < 24, it calls getifaddrs that's specific to Android.
For all other situations, it uses Envoy's default getifaddrs() impl.

It is discovered that the default getifaddrs() doesn't quite work with Android with ndk level >=24. It's not able to send traffic in IPV6 but works fine in IPV4.
This is not an issue now since all Envoy-mobile applications are built with <24 ndk. But it's an ticking bomb that will go off with future toolchain upgrade.

It's verified that the <24 code path also works with >=24 build. Thus the easiest solution is to remove the ANDROID_API < 24 guard and jus run the Android specific getifaddrs() for all Android ndk versions.

@RenjieTang RenjieTang added bug triage Issue requires triage labels Feb 2, 2023
@ggreenway
Copy link
Contributor

cc @envoyproxy/envoy-mobile-maintainers

@RenjieTang
Copy link
Contributor Author

When running getifaddrs on the backward compatible Android path, the result I get is [fe80::f8f3:11ff:fef4:25a8]:0
On the generic path, I get [fe80::f8f3:11ff:fef4:25a8%20]:0.

The difference here is that the latter contains a scope id that's specific to link-local IPV6 address.

I did some hacking of stripping the scope id from the generic path result, and traffic goes back to normal.

I think the root issue is likely that Envoy-mobile is not able to handle outbound traffic with scope id on Android.

RyanTheOptimist pushed a commit that referenced this issue Feb 8, 2023
Commit Message: Remove scope id from ipv6 address in getLocalAddress
Additional Description: This fixes the issue where Envoy-mobile fails to send out any packet on ipv6.
Risk Level: Low
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
Fixes #25326

Signed-off-by: Renjie Tang <renjietang@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants