Patchwork [libnftables] data_reg: conditional XML code for snprintf_xml

login
register
mail settings
Submitter Arturo Borrero
Date May 28, 2013, 3:06 p.m.
Message ID <20130528150621.5259.2187.stgit@nfdev.cica.es>
Download mbox | patch
Permalink /patch/246882/
State Accepted
Headers show

Comments

Arturo Borrero - May 28, 2013, 3:06 p.m.
Having or not XML parsing support doesn't break XML printing.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 src/expr/data_reg.c |    5 -----
 1 file changed, 5 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira - May 29, 2013, 12:11 p.m.
On Tue, May 28, 2013 at 05:06:21PM +0200, Arturo Borrero wrote:
> Having or not XML parsing support doesn't break XML printing.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
index c0a048c..24497ff 100644
--- a/src/expr/data_reg.c
+++ b/src/expr/data_reg.c
@@ -262,7 +262,6 @@  static
 int nft_data_reg_value_snprintf_xml(char *buf, size_t size,
 				    union nft_data_reg *reg, uint32_t flags)
 {
-#ifdef XML_PARSING
 	int len = size, offset = 0, ret, i, j;
 	uint8_t *tmp;
 	int data_len = reg->len/sizeof(uint32_t);
@@ -292,10 +291,6 @@  int nft_data_reg_value_snprintf_xml(char *buf, size_t size,
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
 	return offset;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
 }
 
 static int