Skip to content

Add bindings for libnftnl 1.1.3 through 1.3.0#83

Merged
hulthe merged 5 commits intomainfrom
update-nftnl-sys
Nov 11, 2025
Merged

Add bindings for libnftnl 1.1.3 through 1.3.0#83
hulthe merged 5 commits intomainfrom
update-nftnl-sys

Conversation

@hulthe
Copy link
Contributor

@hulthe hulthe commented Nov 10, 2025

supercedes #75, #62, #53


This change is Reviewable

cherry-picked from 244b28e

Author: Michael Yang <[email protected]>
Date:   Mon Jun 3 06:09:41 2024 +1000

    feat(nftnl-sys): update libnftnl all the way to 1.2.6

    Fix bash script bindgen options and version comment.

    Add version features to `nftnl-sys` and `nftnl`.

    Add `/lib/` to .gitignore to keep libnftnl directories.
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

:lgtm:

@MarkusPettersson98 reviewed 17 of 42 files at r1, all commit messages.
Reviewable status: 0 of 42 files reviewed, 1 unresolved discussion (waiting on @Serock3)


nftnl/src/expr/verdict.rs line 67 at r1 (raw file):

    unsafe fn to_immediate_expr(&self, immediate_const: i32) -> *mut sys::nftnl_expr {
        let expr = try_alloc!(unsafe {
            sys::nftnl_expr_alloc(b"immediate\0" as *const _ as *const c_char)

⛏️ This could be replaced with

c"immediate".as_ptr()

which is kind of goated, ngl

Edit: I saw that you already made this refactor elsewhere after writing this ⛏️ xd

Code quote:

b"immediate\0" as *const _ as *const c_char)

Copy link
Contributor Author

@hulthe hulthe left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 42 files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98 and @Serock3)


nftnl/src/expr/verdict.rs line 67 at r1 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

⛏️ This could be replaced with

c"immediate".as_ptr()

which is kind of goated, ngl

Edit: I saw that you already made this refactor elsewhere after writing this ⛏️ xd

good catch, cstr is great :D

Copy link
Contributor Author

@hulthe hulthe left a comment

Choose a reason for hiding this comment

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

@hulthe reviewed 8 of 42 files at r1, 14 of 14 files at r2.
Reviewable status: 0 of 52 files reviewed, all discussions resolved (waiting on @MarkusPettersson98 and @Serock3)


nftnl/src/expr/verdict.rs line 67 at r1 (raw file):

Previously, hulthe (Joakim Hulthe) wrote…

good catch, cstr is great :D

done

Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

@MarkusPettersson98 reviewed 14 of 14 files at r2, all commit messages.
Reviewable status: 0 of 52 files reviewed, all discussions resolved (waiting on @hulthe and @Serock3)

@hulthe hulthe merged commit 2a2abd4 into main Nov 11, 2025
8 of 9 checks passed
@hulthe hulthe deleted the update-nftnl-sys branch November 11, 2025 12:24
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