netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] meta: properly align types in meta_template table
@ 2014-12-11 22:21 Patrick McHardy
  2014-12-11 22:21 ` [PATCH 2/3] dtype: fix memory leak in concat_type_destroy() Patrick McHardy
  2014-12-11 22:21 ` [PATCH 3/3] datatype: print datatype name in datatype_print() BUG message Patrick McHardy
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick McHardy @ 2014-12-11 22:21 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

Don't use arbitrary amounts of spaces. The remaining table is
properly aligned, fix the new types.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 src/meta.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/meta.c b/src/meta.c
index f33837c..6ff5fc8 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -398,19 +398,19 @@ static const struct meta_template meta_templates[] = {
 	[NFT_META_BRI_OIFNAME]	= META_TEMPLATE("obriport",  &string_type,
 						IFNAMSIZ * BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
-	[NFT_META_PKTTYPE]	= META_TEMPLATE("pkttype",  &pkttype_type,
+	[NFT_META_PKTTYPE]	= META_TEMPLATE("pkttype",   &pkttype_type,
 						BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
-	[NFT_META_CPU]		= META_TEMPLATE("cpu",  &integer_type,
+	[NFT_META_CPU]		= META_TEMPLATE("cpu",	     &integer_type,
 						4 * BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
-	[NFT_META_IIFGROUP]	= META_TEMPLATE("iifgroup", &devgroup_type,
+	[NFT_META_IIFGROUP]	= META_TEMPLATE("iifgroup",  &devgroup_type,
 						4 * BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
-	[NFT_META_OIFGROUP]	= META_TEMPLATE("oifgroup", &devgroup_type,
+	[NFT_META_OIFGROUP]	= META_TEMPLATE("oifgroup",  &devgroup_type,
 						4 * BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
-	[NFT_META_CGROUP]	= META_TEMPLATE("cgroup",  &integer_type,
+	[NFT_META_CGROUP]	= META_TEMPLATE("cgroup",    &integer_type,
 						4 * BITS_PER_BYTE,
 						BYTEORDER_HOST_ENDIAN),
 };
-- 
2.1.0


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

* [PATCH 2/3] dtype: fix memory leak in concat_type_destroy()
  2014-12-11 22:21 [PATCH 1/3] meta: properly align types in meta_template table Patrick McHardy
@ 2014-12-11 22:21 ` Patrick McHardy
  2014-12-11 22:21 ` [PATCH 3/3] datatype: print datatype name in datatype_print() BUG message Patrick McHardy
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2014-12-11 22:21 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

Free allocated memory for ->desc.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 src/datatype.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/datatype.c b/src/datatype.c
index db3fb06..5599c59 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -950,6 +950,8 @@ const struct datatype *concat_type_alloc(const struct expr *expr)
 
 void concat_type_destroy(const struct datatype *dtype)
 {
-	if (dtype->flags & DTYPE_F_ALLOC)
+	if (dtype->flags & DTYPE_F_ALLOC) {
+		xfree(dtype->desc);
 		xfree(dtype);
+	}
 }
-- 
2.1.0


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

* [PATCH 3/3] datatype: print datatype name in datatype_print() BUG message
  2014-12-11 22:21 [PATCH 1/3] meta: properly align types in meta_template table Patrick McHardy
  2014-12-11 22:21 ` [PATCH 2/3] dtype: fix memory leak in concat_type_destroy() Patrick McHardy
@ 2014-12-11 22:21 ` Patrick McHardy
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2014-12-11 22:21 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 src/datatype.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/datatype.c b/src/datatype.c
index 5599c59..4519d87 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -87,7 +87,8 @@ void datatype_print(const struct expr *expr)
 			return symbolic_constant_print(dtype->sym_tbl, expr);
 	} while ((dtype = dtype->basetype));
 
-	BUG("datatype has no print method or symbol table\n");
+	BUG("datatype %s has no print method or symbol table\n",
+	    expr->dtype->name);
 }
 
 struct error_record *symbol_parse(const struct expr *sym,
-- 
2.1.0


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

end of thread, other threads:[~2014-12-11 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 22:21 [PATCH 1/3] meta: properly align types in meta_template table Patrick McHardy
2014-12-11 22:21 ` [PATCH 2/3] dtype: fix memory leak in concat_type_destroy() Patrick McHardy
2014-12-11 22:21 ` [PATCH 3/3] datatype: print datatype name in datatype_print() BUG message 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).