Skip to content

Commit b3a9e76

Browse files
authored
Fix Docker issue that could cause slow system startup (#4369)
A bug introduced in Docker v28.2+ can cause slow container restart in some cases because of usage of IPv4 mapped IPv6 addresses in iptables command. Backport a simple patch from upstream to fix it before we bump to a newer Docker version. Fixes #4363
1 parent af87ada commit b3a9e76

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 050f3d1930d9bf4fea986ed21feaaa6474822191 Mon Sep 17 00:00:00 2001
2+
From: Rob Murray <[email protected]>
3+
Date: Wed, 27 Aug 2025 16:37:00 +0100
4+
Subject: [PATCH] Unmap IPv4 addresses loaded from store
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
When a endpoint's net.IPNet is loaded from store and converted
10+
to a netip.Addr, unmap it so that iptables rules don't contain
11+
IPv4-mapped IPv6 addresses.
12+
13+
Signed-off-by: Rob Murray <[email protected]>
14+
(cherry picked from commit 071e6472db32a34ed0f73f7166e0c2b405ae23a5)
15+
Signed-off-by: Rob Murray <[email protected]>
16+
(backported for 28.3.3 from 31f405932a349e99f45388afe764ec5433b30de2)
17+
Signed-off-by: Jan Čermák <[email protected]>
18+
---
19+
libnetwork/drivers/bridge/bridge_linux.go | 1 +
20+
1 file changed, 1 insertion(+)
21+
22+
diff --git a/libnetwork/drivers/bridge/bridge_linux.go b/libnetwork/drivers/bridge/bridge_linux.go
23+
index 19fcf43..15002f2 100644
24+
--- a/libnetwork/drivers/bridge/bridge_linux.go
25+
+++ b/libnetwork/drivers/bridge/bridge_linux.go
26+
@@ -1218,6 +1218,7 @@ func (d *driver) CreateEndpoint(ctx context.Context, nid, eid string, ifInfo dri
27+
func (ep *bridgeEndpoint) netipAddrs() (v4, v6 netip.Addr) {
28+
if ep.addr != nil {
29+
v4, _ = netip.AddrFromSlice(ep.addr.IP)
30+
+ v4 = v4.Unmap()
31+
}
32+
if ep.addrv6 != nil {
33+
v6, _ = netip.AddrFromSlice(ep.addrv6.IP)

0 commit comments

Comments
 (0)