Skip to content

network: allow Apple platforms to force IPv6 sockets#21913

Merged
mattklein123 merged 5 commits intoenvoyproxy:mainfrom
jpsim:network-allow-non-android-platforms-to-force-ipv6-sockets
Jun 28, 2022
Merged

network: allow Apple platforms to force IPv6 sockets#21913
mattklein123 merged 5 commits intoenvoyproxy:mainfrom
jpsim:network-allow-non-android-platforms-to-force-ipv6-sockets

Conversation

@jpsim
Copy link
Contributor

@jpsim jpsim commented Jun 27, 2022

We suspect that under some conditions, non-Android platforms (i.e. iOS) also would benefit from forcibly using IPv6 sockets, so to validate this this change adds a new runtime feature generalizing the one added for Android.

Risk Level: Low, runtime guard defaults to false.
Testing: Tested on an iPhone 13 Pro via Envoy Mobile, confirmed that an IPv4 address was being mapped to an IPv6 one.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: Not platform specific, but intended to be used on Apple platforms.
Runtime guard: envoy.reloadable_features.always_use_v6 (default false)

We suspect that under some conditions, non-Android platforms (i.e. iOS)
also would benefit from forcibly using IPv6 sockets, so to validate this
this change adds a new runtime feature generalizing the one added for
Android.

Signed-off-by: JP Simard <jp@jpsim.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #21913 was opened by jpsim.

see: more, trace.

@jpsim
Copy link
Contributor Author

jpsim commented Jun 27, 2022

Marked as draft as I test in Envoy Mobile.

jpsim added 4 commits June 27, 2022 17:33
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
And only apply `forceV6()` on Android or Apple platforms.

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim marked this pull request as ready for review June 28, 2022 16:10
sin6.sin6_addr.s6_addr32[2] = htonl(0xffff);
sin6.sin6_addr.s6_addr32[3] = sin4.sin_addr.s_addr;
#elif defined(__APPLE__)
sin6.sin6_addr.__u6_addr.__u6_addr32[2] = htonl(0xffff);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linux headers on the left, Darwin on the right.

image

@jpsim
Copy link
Contributor Author

jpsim commented Jun 28, 2022

/assign @mattklein123 @Augustyniak

@jpsim jpsim changed the title network: allow non-Android platforms to force IPv6 sockets network: allow Apple platforms to force IPv6 sockets Jun 28, 2022
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mattklein123 mattklein123 merged commit f28526e into envoyproxy:main Jun 28, 2022
@jpsim jpsim deleted the network-allow-non-android-platforms-to-force-ipv6-sockets branch June 28, 2022 18:59
jpsim added a commit to envoyproxy/envoy-mobile that referenced this pull request Jun 28, 2022
Mirroring what was done for Android in
#2379 and leveraging the
recent changes in Envoy in
envoyproxy/envoy#21913.

Risk Level: Moderate.
Testing: Unit tests, integration tests & being exercised in the
experimental app. Tested with the experimental app in the iOS Simulator
and on an iPhone 13 Pro, verified that an IPv4 address gets mapped to a
valid IPv6 address.
Docs Changes: Added.
Release Notes: Added.

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Nov 29, 2022
Mirroring what was done for Android in
envoyproxy/envoy-mobile#2379 and leveraging the
recent changes in Envoy in
#21913.

Risk Level: Moderate.
Testing: Unit tests, integration tests & being exercised in the
experimental app. Tested with the experimental app in the iOS Simulator
and on an iPhone 13 Pro, verified that an IPv4 address gets mapped to a
valid IPv6 address.
Docs Changes: Added.
Release Notes: Added.

Signed-off-by: JP Simard <jp@jpsim.com>
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.

3 participants