Skip to content

Conversation

@robmry
Copy link
Contributor

@robmry robmry commented Aug 27, 2025

- What I did

IPv4-mapped IPv6 addresses are accepted by iptables, and do the right thing (so there's no obvious behavioural change). But, maybe this will help with the linked issue, or at-least rule out a potential difference from rules in 28.0.x.

- How I did it

When converting an endpoint's IPv4 net.IPNet to a netip.Addr, unmap it so that iptables rules don't contain IPv4-mapped IPv6 addresses - which they do otherwise, when the net.IPNet is loaded from the store.

- How to verify it

  • Enable live-restore.
  • docker network create b4
  • docker run -d --rm --network b4 --name c1 busybox top
  • Restart the daemon.

Without the change ...

DEBU[2025-08-27T16:21:36.545721342Z] Network (33c8cf6) restored
DEBU[2025-08-27T16:21:36.545868426Z] /usr/sbin/iptables, [--wait -t raw -C PREROUTING -d ::ffff:172.19.0.2 ! -i br-c4ed16cae1fd -j DROP]
DEBU[2025-08-27T16:21:36.546533634Z] Endpoint (8f9cd0f) restored to network (c4ed16c)

With the change ...

DEBU[2025-08-27T16:20:24.777808878Z] Network (170c742) restored
DEBU[2025-08-27T16:20:24.777946628Z] /usr/sbin/iptables, [--wait -t raw -C PREROUTING -d 172.19.0.2 ! -i br-c4ed16cae1fd -j DROP]
DEBU[2025-08-27T16:20:24.778534628Z] Endpoint (8f9cd0f) restored to network (c4ed16c)

- Human readable description for the release notes

- Fix an issue that could cause slow container restart on live-restore.

When a endpoint's net.IPNet is loaded from store and converted
to a netip.Addr, unmap it so that iptables rules don't contain
IPv4-mapped IPv6 addresses.

Signed-off-by: Rob Murray <[email protected]>
(cherry picked from commit 071e647)
Signed-off-by: Rob Murray <[email protected]>
@robmry robmry added this to the 28.4.0 milestone Aug 27, 2025
@robmry robmry self-assigned this Aug 27, 2025
@robmry robmry requested a review from thaJeztah August 27, 2025 18:55
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants