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

Panic during deserialization in get_current_ruleset function #6

Closed
selfuryon opened this issue Jul 16, 2023 · 3 comments · Fixed by #9
Closed

Panic during deserialization in get_current_ruleset function #6

selfuryon opened this issue Jul 16, 2023 · 3 comments · Fixed by #9
Assignees
Labels
bug Something isn't working

Comments

@selfuryon
Copy link

Hello!
I tried to use get_current_ruleset function, but it panicked:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("data did not match any variant of untagged enum NfObject", line: 1, column: 1814)', src/firewall.rs:31:64

I use NixOS and my current ruleset (nft -j list ruleset with replaced IP addresses) is here.

@JKRhb JKRhb added the bug Something isn't working label Jul 16, 2023
@JKRhb
Copy link
Member

JKRhb commented Aug 12, 2023

Hi @selfuryon, thank you for reporting this issue! Could you try again with the latest crate version? :) With the fix provided in #8, the function should not panic anymore.

@jwhb
Copy link
Member

jwhb commented Aug 12, 2023

@selfuryon: Thanks for providing your ruleset. There were indeed a some unimplemented pieces around sets and the XT statement.

Your ruleset can be interpreted after the changes that I committed to this branch: https://github.com/namib-project/nftables-rs/tree/anonymous-sets

Could you please confirm that this works for you?

@jwhb
Copy link
Member

jwhb commented Aug 12, 2023

The fixes will be available as #9.

@jwhb jwhb linked a pull request Aug 12, 2023 that will close this issue
@jwhb jwhb closed this as completed in #9 Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants