Skip to content

Mimic ipset C code for determining correct default ipset revision for hash:ip{port,net,etc} #1031

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

Conversation

bleggett
Copy link
Contributor

@bleggett bleggett commented Nov 18, 2024

Fixes #1030

It takes both desired features AND set type into account when determining the "correct" default revision, which is how it actually works in the ipset userspace binary.

e.g.

hash:ip,port,net

  • with comment support? Revision 5.
  • with counter support? Revision 4.

etc etc.

A more exhaustive mapping would be ideal, but this PR only does default revision mappings for the ipset types that previously had revision defaulting logic, and not all possible ipset types globally.

@bleggett bleggett force-pushed the bleggett/correctly-derive-ipset-revision branch 3 times, most recently from 437fb9b to d1562a9 Compare November 18, 2024 23:00
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett bleggett force-pushed the bleggett/correctly-derive-ipset-revision branch from d1562a9 to bf21466 Compare November 18, 2024 23:02
@aboch
Copy link
Collaborator

aboch commented May 9, 2025

LGTM

@aboch aboch merged commit 1f4f72c into vishvananda:main May 9, 2025
2 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.

ipset revision usage is inconsistent with ipset binary from netfilter
2 participants