Compare commits

..

2 Commits

Author SHA1 Message Date
Antonio Ojea ca560006a1
Merge 3d223a54e6 into 69f487d596 2025-02-02 15:55:52 +00:00
Antonio Ojea 3d223a54e6 nf2go: convert nftables rules to golang code
One of the biggest barriers to adopt the netlink format for nftables is
the complexity of writing bytecode.

This commits adds a tool that allows to take an nftables dump and
generate the corresponding golang code and validating that the generated
code produces the exact same output.

Change-Id: I491b35e0d8062de33c67091dd4126d843b231838
Signed-off-by: Antonio Ojea <aojea@google.com>
2025-02-02 15:55:41 +00:00
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ func main() {
log.Printf("Expected output:\n%s", string(expectedOutput)) log.Printf("Expected output:\n%s", string(expectedOutput))
log.Printf("Actual output:\n%s", actualOutput) log.Printf("Actual output:\n%s", actualOutput)
log.Fatalf("nftables ruleset mismatch:\n%s", cmp.Diff(string(expectedOutput), actualOutput)) log.Fatalf("nftables ruleset mismatch:\n%s", cmp.Diff(expectedOutput, actualOutput))
} }
if err := flushNFTRuleset(); err != nil { if err := flushNFTRuleset(); err != nil {