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

[26.1 backport] Option to avoid deleting the kernel_ll address from bridges. #47775

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Apr 29, 2024

- What I did

As discussed in this Slack thread, replacing the kernel-assigned link local address on bridges may be causing issues.

It'd be better not to replace it, and there shouldn't be any consequences but, to avoid the risk of a breaking change in a patch release - this PR introduces an environment variable that only modifies the current behaviour when set.

The kernel-ll address has been removed since #46850 - part of an attempt to prevent daemon startup failures following changes in fixed-cidr-v6. But, by treating the standard LL prefix as a special case, removal of the kernel-assigned LL address can be avoided.

This will make it possible to experiment and hopefully work around the problem. In 27.0 we should remove the env var and make the new behaviour the default, or revert this change. (I'll create an issue to track that if this change makes it in.)

- How I did it

If env var DOCKER_BRIDGE_PRESERVE_KERNEL_LL=1, don't assign fe80::1/64 to a bridge, and don't delete any link local address with prefix fe80::/64.

- How to verify it

Modified regression test, just to make sure setting the new env var doesn't cause any startup problems for the default bridge, and that it still ends up with a link-local address.

Without the env var set, for a user-defined network ...

docker network create n6 --ipv6 --subnet fdaa::/64
docker run --rm --name c1 -dti --network n6 alpine

12: br-6ae7b0edf268: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:07:85:54:ba brd ff:ff:ff:ff:ff:ff
    inet 172.19.0.1/16 brd 172.19.255.255 scope global br-6ae7b0edf268
       valid_lft forever preferred_lft forever
    inet6 fdaa::1/64 scope global tentative
       valid_lft forever preferred_lft forever
    inet6 fe80::42:7ff:fe85:54ba/64 scope link tentative
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link tentative
       valid_lft forever preferred_lft forever

dockerd restart ...

12: br-6ae7b0edf268: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:07:85:54:ba brd ff:ff:ff:ff:ff:ff
    inet 172.19.0.1/16 brd 172.19.255.255 scope global br-6ae7b0edf268
       valid_lft forever preferred_lft forever
    inet6 fdaa::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever

With the env var set ...

Initially, and after daemon restart ...

17: br-e476bcfaa2de: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:c8:2b:c2:4a brd ff:ff:ff:ff:ff:ff
    inet 172.19.0.1/16 brd 172.19.255.255 scope global br-e476bcfaa2de
       valid_lft forever preferred_lft forever
    inet6 fdaa::1/64 scope global tentative
       valid_lft forever preferred_lft forever
    inet6 fe80::42:c8ff:fe2b:c24a/64 scope link tentative
       valid_lft forever preferred_lft forever

- Description for the changelog

Experimental environment variable `DOCKER_BRIDGE_PRESERVE_KERNEL_LL=1` will prevent the daemon from removing the kernel-assigned link local address on a Linux bridge.

If env var DOCKER_BRIDGE_PRESERVE_KERNEL_LL=1, don't assign fe80::1/64
to a bridge, and don't delete any link local address with prefix fe80::/64.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 57ada4b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added this to the 26.1.1 milestone Apr 29, 2024
@vvoland vvoland self-assigned this Apr 29, 2024
@vvoland vvoland marked this pull request as ready for review April 30, 2024 09:27
@vvoland vvoland merged commit ac2de55 into moby:26.1 Apr 30, 2024
143 of 144 checks passed
renovate bot added a commit to earthly/dind that referenced this pull request May 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/docker](https://togithub.com/docker/docker) | patch | `26.1.0`
-> `26.1.1` |

---

### Release Notes

<details>
<summary>docker/docker (docker/docker)</summary>

### [`v26.1.1`](https://togithub.com/moby/moby/releases/tag/v26.1.1)

[Compare
Source](https://togithub.com/docker/docker/compare/v26.1.0...v26.1.1)

#### 26.1.1

For a full list of pull requests and changes in this release, refer to
the relevant GitHub milestones:

- [docker/cli, 26.1.1
milestone](https://togithub.com/docker/cli/issues?q=is%3Aclosed+milestone%3A26.1.1)
- [moby/moby, 26.1.1
milestone](https://togithub.com/moby/moby/issues?q=is%3Aclosed+milestone%3A26.1.1)
- Deprecated and removed features, see [Deprecated
Features](https://togithub.com/docker/cli/blob/v26.1.1/docs/deprecated.md).
- Changes to the Engine API, see [API version
history](https://togithub.com/moby/moby/blob/v26.1.1/docs/api/version-history.md).

##### Bug fixes and enhancements

- Fix `docker run -d` printing an `context canceled` spurious error when
OTEL is configured.
[docker/cli#5044](https://togithub.com/docker/cli/pull/5044)
- Experimental environment variable `DOCKER_BRIDGE_PRESERVE_KERNEL_LL=1`
will prevent the daemon from removing the kernel-assigned link local
address on a Linux bridge.
[moby/moby#47775](https://togithub.com/moby/moby/pull/47775)
- Resolve an issue preventing container creation on hosts with a
read-only `/proc/sys/net` filesystem. If IPv6 cannot be disabled on an
interface due to this, either disable IPv6 by default on the host or
ensure `/proc/sys/net` is read-write. Otherwise, start dockerd with
`DOCKER_ALLOW_IPV6_ON_IPV4_INTERFACE=1` to bypass the error.
[moby/moby#47769](https://togithub.com/moby/moby/pull/47769)

> \[!NOTE]
> The `DOCKER_ALLOW_IPV6_ON_IPV4_INTERFACE` is added as a temporary fix
and will be phased out in a future major release after simplifying the
IPv6 enablement process.

##### Packaging updates

- Update BuildKit to
[v0.13.2](https://togithub.com/moby/buildkit/releases/tag/v0.13.2).
[moby/moby#47762](https://togithub.com/moby/moby/pull/47762)
- Update Compose to
[v2.27.0](https://togithub.com/docker/compose/releases/tag/v2.27.0).
[docker/docker-ce-packages#1017](https://togithub.com/docker/docker-ce-packaging/pull/1017)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6am on monday" (UTC), Automerge
- At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/earthly/dind).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to earthly/dind that referenced this pull request May 3, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/docker](https://togithub.com/docker/docker) | patch | `26.1.0`
-> `26.1.1` |

---

### Release Notes

<details>
<summary>docker/docker (docker/docker)</summary>

### [`v26.1.1`](https://togithub.com/moby/moby/releases/tag/v26.1.1)

[Compare
Source](https://togithub.com/docker/docker/compare/v26.1.0...v26.1.1)

#### 26.1.1

For a full list of pull requests and changes in this release, refer to
the relevant GitHub milestones:

- [docker/cli, 26.1.1
milestone](https://togithub.com/docker/cli/issues?q=is%3Aclosed+milestone%3A26.1.1)
- [moby/moby, 26.1.1
milestone](https://togithub.com/moby/moby/issues?q=is%3Aclosed+milestone%3A26.1.1)
- Deprecated and removed features, see [Deprecated
Features](https://togithub.com/docker/cli/blob/v26.1.1/docs/deprecated.md).
- Changes to the Engine API, see [API version
history](https://togithub.com/moby/moby/blob/v26.1.1/docs/api/version-history.md).

##### Bug fixes and enhancements

- Fix `docker run -d` printing an `context canceled` spurious error when
OTEL is configured.
[docker/cli#5044](https://togithub.com/docker/cli/pull/5044)
- Experimental environment variable `DOCKER_BRIDGE_PRESERVE_KERNEL_LL=1`
will prevent the daemon from removing the kernel-assigned link local
address on a Linux bridge.
[moby/moby#47775](https://togithub.com/moby/moby/pull/47775)
- Resolve an issue preventing container creation on hosts with a
read-only `/proc/sys/net` filesystem. If IPv6 cannot be disabled on an
interface due to this, either disable IPv6 by default on the host or
ensure `/proc/sys/net` is read-write. Otherwise, start dockerd with
`DOCKER_ALLOW_IPV6_ON_IPV4_INTERFACE=1` to bypass the error.
[moby/moby#47769](https://togithub.com/moby/moby/pull/47769)

> \[!NOTE]
> The `DOCKER_ALLOW_IPV6_ON_IPV4_INTERFACE` is added as a temporary fix
and will be phased out in a future major release after simplifying the
IPv6 enablement process.

##### Packaging updates

- Update BuildKit to
[v0.13.2](https://togithub.com/moby/buildkit/releases/tag/v0.13.2).
[moby/moby#47762](https://togithub.com/moby/moby/pull/47762)
- Update Compose to
[v2.27.0](https://togithub.com/docker/compose/releases/tag/v2.27.0).
[docker/docker-ce-packages#1017](https://togithub.com/docker/docker-ce-packaging/pull/1017)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6am on monday" (UTC), Automerge
- At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/earthly/dind).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants