Don't configure IPv6 addr/gw when IPv6 disabled.#47521
Merged
vvoland merged 1 commit intomoby:masterfrom Mar 7, 2024
Merged
Conversation
When IPv6 is disabled in a container by, for example, using the --sysctl option - an IPv6 address/gateway is still allocated. Don't attempt to apply that config because doing so enables IPv6 on the interface. Signed-off-by: Rob Murray <[email protected]>
5a6c7cc to
ef5295c
Compare
corhere
approved these changes
Mar 6, 2024
vvoland
approved these changes
Mar 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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=1did 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
::1interface (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