Don't configure IPv6 addr/gw when IPv6 disabled. #47521
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
In 25.x, a container started with
--sysctl=net.ipv6.conf.all.disable_ipv6=1
did not end up with IPv6 addresses on its interfaces.#47062 delays setup of network interfaces until after the OS sandbox has been created, so that the container can be inspected for a
::1
interface (initially, in order to exclude IPv6 entries from/etc/hosts
). So, interfaces were previously configured after the runtime has applied the sysctl setting, now they're configured afterwards.Until #47406 makes it in, IPv6 addresses are still allocated if a container is connected to an IPv6 network. The code that adds an IPv6 address also enables IPv6 on the interface.
That didn't matter when it happened before the runtime applied the sysctl to disable IPv6, now it does.
- How I did it
Don't add an IPv6 address or gateway to a container that's got IPv6 disabled.
- How to verify it
New integration test, without this change it fails with ...
- Description for the changelog