Repository navigation
Conversation
Problem
With dual-stack enabled (--ipv6), proxy-init runs BuildFirewallConfiguration
once for iptables and once for ip6tables, and both passes receive the full
--subnets-to-ignore list. Mixing families, or passing only IPv4 or only IPv6
subnets, makes one of the two commands fail:
ip6tables v1.8.11 (nf_tables): host/network `10.0.0.0/8' not found
and the linkerd-init container (or the CNI plugin, which shares the same
code path) exits, so the pod never starts.
Solution
Keep only the subnets of the family being programmed in each pass, and log
the skipped ones at debug level. The family is taken from the parsed mask
length, so IPv4-mapped IPv6 CIDRs go to ip6tables, the only binary that
accepts them.
Validation
New cases in TestBuildFirewallConfiguration cover mixed subnets in both
passes, IPv4-only subnets in the IPv6 pass, IPv6-only subnets on a
single-stack IPv4 pod, and IPv4-mapped CIDRs. They fail on main and pass with
this change; go test, go vet and golangci-lint are clean for proxy-init.
Picks up linkerd#696, inactive since April 2026, and
addresses the review comments left there.
Co-authored-by: Kevin Button <kevin@thinkingmachines.ai>
Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
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.
Picks up #696 by @panic-kbutton, inactive since April 2026, and addresses the review comments left there. The original change is kept and credited with
Co-authored-by.Problem
With dual-stack enabled (
--ipv6), proxy-init callsBuildFirewallConfigurationonce for iptables and once for ip6tables, and both passes get the full--subnets-to-ignorelist. Any IPv4 subnet ends up in an ip6tables command (and any IPv6 subnet in an iptables command), which fails:linkerd-initexits and the pod never starts. The CNI plugin goes through the same function, so it is affected too. In practice this meansconfig.linkerd.io/skip-subnets(orproxyInit.skipSubnets) can't be used on dual-stack clusters at all, and an IPv6 subnet can't be skipped on a single-stack IPv4 pod.Solution
Each pass keeps only the subnets of the address family it programs. Subnets of the other family are logged at debug level and skipped, as suggested in the review of #696. The family comes from the parsed mask length, not
IP.To4(), so an IPv4-mapped CIDR such as::ffff:10.0.0.0/104goes to ip6tables, the only binary that accepts that notation.Validation
New cases in
TestBuildFirewallConfiguration:They fail on
mainand pass with this change.go test ./proxy-init/... ./pkg/... ./internal/...,go vetandgolangci-lint(repo config) are clean. Thecni-plugin/integrationtests need the CI mounts and weren't run locally.AI disclosure: written with the help of Claude Code, reviewed and tested by me.