Skip to content

add proxyInit dual-stack conditional#696

Open
panic-kbutton wants to merge 1 commit intolinkerd:mainfrom
panic-kbutton:proxy-init-patch
Open

add proxyInit dual-stack conditional#696
panic-kbutton wants to merge 1 commit intolinkerd:mainfrom
panic-kbutton:proxy-init-patch

Conversation

@panic-kbutton
Copy link
Copy Markdown

when running Linkerd in dual stack mode today, skipSubnets breaks proxyInit with error similar to:

time="2026-03-18T00:21:37Z" level=info msg="/usr/sbin/ip6tables-nft -t nat -A PROXY_INIT_REDIRECT -p all -j RETURN -s <ipv4-cidr-here> -m comment --comment proxy-init/ignore-subnet-<ipv4-cidr-here>"
time="2026-03-18T00:21:37Z" level=info msg="ip6tables v1.8.11 (nf_tables): host/network `<ipv4-cidr-here>' not found\nTry `ip6tables -h' or 'ip6tables --help' for more information.\n"

this breaks when passing either ipv4 or ipv6 subnets to skip subnets (or both), where either the iptables-nft or ip6tables-nft command breaks with the wrong subnet. This PR adds a conditional to verify subnet parsing with the right scheme so that on each invocation only the right subnets are parsed

@panic-kbutton panic-kbutton requested a review from a team as a code owner March 18, 2026 00:46
Signed-off-by: Kevin Button <kevin@thinkingmachines.ai>
@panic-kbutton
Copy link
Copy Markdown
Author

@alpeb any more info needed for this change? thanks!

Copy link
Copy Markdown
Member

@unleashed unleashed left a comment

Choose a reason for hiding this comment

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

Thanks for your submission, @panic-kbutton!

I just noticed a couple improvements we could have (see comments).

Comment thread proxy-init/cmd/root.go
Comment on lines +204 to +206
if isIPv6Subnet != options.IPv6 {
continue
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe avoid silently dropping non-matched subnets?

Suggested change
if isIPv6Subnet != options.IPv6 {
continue
}
if isIPv6Subnet != options.IPv6 {
log.Debugf("skipping subnet %s: doesn't match current stack (ipv6=%v)", subnet, options.IPv6)
continue
}

}
})

t.Run("It handles IPv4-only subnets with dual-stack enabled", func(t *testing.T) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're missing the case of IPv6-only subnets with single-stack IPv4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants