namib-project / nftables-rs

Safe abstraction for nftables JSON API (libnftables-json).
https://crates.io/crates/nftables
Apache License 2.0
23 stars 13 forks source link

Fix insert #2

Closed thosmos closed 1 year ago

thosmos commented 1 year ago

Previously adding an insert Rule directly to an NfCmd::Insert was leaving out the necessary {"insert": ...} json object from the output. By changing NfCmd::Insert to take an NfListObject, it matches how the ::Add command works and fixes the output.

jwhb commented 1 year ago

@thosmos Thank you for your contribution, and especially for providing a test and fixing my tests :)