netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To: netfilter-devel@vger.kernel.org
Cc: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Subject: [iptables-nftables - PATCH 1/2] nft: Optimize chain listing if only one is looked for
Date: Wed, 17 Jul 2013 10:34:14 +0300	[thread overview]
Message-ID: <1374046455-19234-2-git-send-email-tomasz.bursztyka@linux.intel.com> (raw)
In-Reply-To: <1374046455-19234-1-git-send-email-tomasz.bursztyka@linux.intel.com>

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
 iptables/nft.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/iptables/nft.c b/iptables/nft.c
index f9a88c9..f33faa5 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -2495,6 +2495,9 @@ int nft_rule_list(struct nft_handle *h, const char *chain, const char *table,
 		}
 		__nft_rule_list(h, c, table, rulenum, format, print_firewall);
 
+		if (chain && strcmp(chain, chain_name) == 0)
+			break;
+
 		found = true;
 
 next:
@@ -2593,6 +2596,9 @@ int nft_rule_list_save(struct nft_handle *h, const char *chain,
 
 		ret = __nft_rule_list(h, c, table, rulenum,
 				      counters ? 0 : FMT_NOCOUNTS, list_save);
+
+		if (chain && strcmp(chain, chain_name) != 0)
+			break;
 next:
 		c = nft_chain_list_iter_next(iter);
 	}
-- 
1.8.2.1


  reply	other threads:[~2013-07-17  7:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  7:34 [iptables-nftables - PATCH 0/2] fixes Tomasz Bursztyka
2013-07-17  7:34 ` Tomasz Bursztyka [this message]
2013-07-17 13:40   ` [iptables-nftables - PATCH 1/2] nft: Optimize chain listing if only one is looked for Pablo Neira Ayuso
2013-07-18 11:10     ` Tomasz Bursztyka
2013-07-17  7:34 ` [iptables-nftables - PATCH 2/2] nft: Fix code style issues Tomasz Bursztyka
2013-07-17 13:47   ` Pablo Neira Ayuso
2013-07-18 11:12     ` Tomasz Bursztyka

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=1374046455-19234-2-git-send-email-tomasz.bursztyka@linux.intel.com \
    --to=tomasz.bursztyka@linux.intel.com \
    --cc=netfilter-devel@vger.kernel.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).