netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arturo Borrero <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: giuseppelng@gmail.com, pablo@netfilter.org
Subject: [libnftables PATCH 2/2] examples: unset chain & rule handle
Date: Wed, 05 Jun 2013 23:37:18 +0200	[thread overview]
Message-ID: <20130605213718.11415.44102.stgit@nfdev.cica.es> (raw)
In-Reply-To: <20130605213713.11415.64106.stgit@nfdev.cica.es>

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

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 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);


  reply	other threads:[~2013-06-05 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 21:37 [libnftables PATCH 1/2] src: add _unset functions Arturo Borrero
2013-06-05 21:37 ` Arturo Borrero [this message]
2013-06-06 10:15 ` Pablo Neira Ayuso
2013-06-06 10:35   ` Arturo Borrero Gonzalez
2013-06-06 11:45     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130605213718.11415.44102.stgit@nfdev.cica.es \
    --to=arturo.borrero.glez@gmail.com \
    --cc=giuseppelng@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).