[libnftables PATCH 2/2] examples: unset chain & rule handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use _unset functions to delete handle so test don't fail.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
---
 examples/nft-chain-xml-add.c |    1 +
 examples/nft-rule-xml-add.c  |    1 +
 2 files changed, 2 insertions(+)

diff --git a/examples/nft-chain-xml-add.c b/examples/nft-chain-xml-add.c
index c8b0fdc..80a513d 100644
--- a/examples/nft-chain-xml-add.c
+++ b/examples/nft-chain-xml-add.c
@@ -69,6 +69,7 @@ int main(int argc, char *argv[])
 	nft_chain_snprintf(reprint, sizeof(reprint), c, NFT_CHAIN_O_XML, 0);
 	printf("Parsed:\n%s\n", reprint);
 
+	nft_chain_attr_unset(c, NFT_CHAIN_ATTR_HANDLE);
 	family = (uint16_t)nft_chain_attr_get_u32(c, NFT_CHAIN_ATTR_FAMILY);
 
 	seq = time(NULL);
diff --git a/examples/nft-rule-xml-add.c b/examples/nft-rule-xml-add.c
index bce3411..7bd44ff 100644
--- a/examples/nft-rule-xml-add.c
+++ b/examples/nft-rule-xml-add.c
@@ -67,6 +67,7 @@ int main(int argc, char *argv[])
 	nft_rule_snprintf(reprint, sizeof(reprint), r, NFT_RULE_O_XML, 0);
 	printf("Parsed:\n%s\n", reprint);
 
+	nft_rule_attr_unset(r, NFT_RULE_ATTR_HANDLE);
 	family = nft_rule_attr_get_u8(r, NFT_RULE_ATTR_FAMILY);
 
 	seq = time(NULL);

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux