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

Process packets only on the POSTROUTING hook (before SNAT) #54

Merged
merged 7 commits into from
Jul 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/networkpolicy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,12 @@ func (c *Controller) syncNFTablesRules(ctx context.Context) error {
tx.Flush(&knftables.Chain{
Name: chainName,
})
// IPv6 needs ICMP Neighbor Discovery to work
tx.Add(&knftables.Rule{
Chain: chainName,
Rule: knftables.Concat(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it's more readable to write all-constant strings as one string (#49 (comment)):

		tx.Add(&knftables.Rule{
			Chain: chainName,
			Rule: "icmpv6 type { nd-neighbor-solicit, nd-neighbor-advert } accept",
		})

(same for other similar cases)

"icmpv6", "type", "{", "nd-neighbor-solicit, nd-neighbor-advert", "}", "accept"),
})
// instead of aggregating all the expresion in one rule, use two different
// rules to understand if is causing issues with UDP packets with the same
// tuple (https://github.com/kubernetes-sigs/kube-network-policies/issues/12)
Expand Down
Loading