Skip to content

fix: wrong ipset name used by ip6tables. #1654

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

Merged
merged 4 commits into from
Apr 26, 2024

Conversation

xujunjie-cover
Copy link
Contributor

@xujunjie-cover xujunjie-cover commented Apr 26, 2024

ipset name has prefix "inet6:" for ipv6. so ip6tables rule also need to convert ipset name.

Issue: #1653

ipset name has prefix "inet6:" for ipv6. so ip6tables rule also need to
convert ipset name.

Signed-off-by: xujunjie-cover <xujunjie37@jd.com>
aauren added 3 commits April 26, 2024 13:39
Naming ipsets with the advent of IPv6 gets tricky because IPv6 ipsets
have to be prefixed with inet6:. This commit adds additional utilities
that help users find the correct name of ipsets.
Use ipSetName utility method to ensure that ipset names are generated
correctly when they are formulated. This feeds into the activeIPSets map
later on, so it is important that we get the name right from the start.
@aauren
Copy link
Collaborator

aauren commented Apr 26, 2024

@xujunjie-cover Thanks for digging into this and being willing to contribute a fix.

When I tested it in my environment, I found that there was still a small problem where it was trying to delete the valid inet6 prefixed ipsets on cleanup.

It looks like this is because the ipset needed to be prefixed correctly when it was generated. I also added some unit tests to this to hopefully prevent regression.

@aauren aauren merged commit d12f422 into cloudnativelabs:master Apr 26, 2024
6 checks passed
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.

2 participants