netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 3/4] segtree: rename set expression set_to_segtree()
Date: Sat, 23 Apr 2016 18:08:39 +0200	[thread overview]
Message-ID: <1461427720-4939-4-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1461427720-4939-1-git-send-email-pablo@netfilter.org>

This function is modified by a follow up patch to take the set object,
so rename it to init.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/segtree.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/segtree.c b/src/segtree.c
index c8d63b8..879264b 100644
--- a/src/segtree.c
+++ b/src/segtree.c
@@ -327,16 +327,16 @@ static unsigned int expr_to_intervals(const struct expr *set,
 	return n;
 }
 
-static int set_to_segtree(struct list_head *msgs, struct expr *set,
+static int set_to_segtree(struct list_head *msgs, struct expr *init,
 			  struct seg_tree *tree)
 {
-	struct elementary_interval *intervals[set->size];
+	struct elementary_interval *intervals[init->size];
 	struct expr *i, *next;
 	unsigned int n;
 
-	n = expr_to_intervals(set, tree->keylen, intervals);
+	n = expr_to_intervals(init, tree->keylen, intervals);
 
-	list_for_each_entry_safe(i, next, &set->expressions, list) {
+	list_for_each_entry_safe(i, next, &init->expressions, list) {
 		list_del(&i->list);
 		expr_free(i);
 	}
@@ -349,9 +349,9 @@ static int set_to_segtree(struct list_head *msgs, struct expr *set,
 	/*
 	 * Insert elements into tree
 	 */
-	for (n = 0; n < set->size; n++) {
-		if (set->set_flags & SET_F_MAP &&
-		    n < set->size - 1 &&
+	for (n = 0; n < init->size; n++) {
+		if (init->set_flags & SET_F_MAP &&
+		    n < init->size - 1 &&
 		    interval_conflict(intervals[n], intervals[n+1]))
 			return expr_binary_error(msgs,
 					intervals[n]->expr,
-- 
2.1.4


  parent reply	other threads:[~2016-04-23 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 16:08 [PATCH nft 0/4] Interval overlap detection for named sets Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 1/4] segtree: set expr->len for prefix expression from interval_map_decompose() Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 2/4] segtree: add expr_to_intervals() Pablo Neira Ayuso
2016-04-23 16:08 ` Pablo Neira Ayuso [this message]
2016-04-23 16:08 ` [PATCH nft 4/4] segtree: add interval overlap detection for dynamic updates Pablo Neira Ayuso
2016-04-25 10:38 ` [PATCH nft 0/4] Interval overlap detection for named sets Patrick McHardy
2016-04-25 11:57   ` Pablo Neira Ayuso
2016-04-25 16:59     ` Patrick McHardy
2016-04-25 21:32       ` Pablo Neira Ayuso
2016-04-25 21:49         ` Patrick McHardy

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=1461427720-4939-4-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --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).