netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] set: remove unused set_clone() function
@ 2015-01-12 10:02 Patrick McHardy
  2015-01-12 10:02 ` [PATCH 2/2] expr: fix crash when listing non-verdict mappings Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2015-01-12 10:02 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

The set_clone() function was added by the event monitor patchset and is
unused. It is also broken since it simply initializes the list head to
the list of the original set, so remove it.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 include/rule.h |  1 -
 src/rule.c     | 18 ------------------
 2 files changed, 19 deletions(-)

diff --git a/include/rule.h b/include/rule.h
index 0c52315..491411e 100644
--- a/include/rule.h
+++ b/include/rule.h
@@ -203,7 +203,6 @@ struct set {
 extern struct set *set_alloc(const struct location *loc);
 extern struct set *set_get(struct set *set);
 extern void set_free(struct set *set);
-extern struct set *set_clone(const struct set *set);
 extern void set_add_hash(struct set *set, struct table *table);
 extern struct set *set_lookup(const struct table *table, const char *name);
 extern struct set *set_lookup_global(uint32_t family, const char *table,
diff --git a/src/rule.c b/src/rule.c
index dd39e8a..feafe26 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -80,24 +80,6 @@ void set_free(struct set *set)
 	xfree(set);
 }
 
-struct set *set_clone(const struct set *set)
-{
-	struct set *newset = set_alloc(&set->location);
-
-	newset->list = set->list;
-	handle_merge(&newset->handle, &set->handle);
-	newset->flags = set->flags;
-	newset->keytype = set->keytype;
-	newset->keylen = set->keylen;
-	newset->datatype = set->datatype;
-	newset->datalen = set->datalen;
-	newset->init = expr_clone(set->init);
-	newset->policy = set->policy;
-	newset->desc.size = set->desc.size;
-
-	return newset;
-}
-
 void set_add_hash(struct set *set, struct table *table)
 {
 	list_add_tail(&set->list, &table->sets);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-12 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 10:02 [PATCH 1/2] set: remove unused set_clone() function Patrick McHardy
2015-01-12 10:02 ` [PATCH 2/2] expr: fix crash when listing non-verdict mappings Patrick McHardy

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).