netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libnftables PATCH] bitwise: xml: export len node
@ 2013-07-08 11:52 Arturo Borrero Gonzalez
  2013-07-08 17:00 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Arturo Borrero Gonzalez @ 2013-07-08 11:52 UTC (permalink / raw)
  To: netfilter-devel

The len unsigned int was not being exported in XML.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 src/expr/bitwise.c                 |    5 +++--
 tests/xmlfiles/20-rule-bitwise.xml |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
index 67c120f..52fc648 100644
--- a/src/expr/bitwise.c
+++ b/src/expr/bitwise.c
@@ -280,8 +280,9 @@ nft_rule_expr_bitwise_snprintf_xml(char *buf, size_t size,
 	int len = size, offset = 0, ret;
 
 	ret = snprintf(buf, len, "<sreg>%u</sreg>"
-				"<dreg>%u</dreg>",
-		       bitwise->sreg, bitwise->dreg);
+				"<dreg>%u</dreg>"
+				"<len>%u</len>",
+		       bitwise->sreg, bitwise->dreg, bitwise->len);
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
 	ret = snprintf(buf+offset, len, "<mask>");
diff --git a/tests/xmlfiles/20-rule-bitwise.xml b/tests/xmlfiles/20-rule-bitwise.xml
index 411e28f..ce2d851 100644
--- a/tests/xmlfiles/20-rule-bitwise.xml
+++ b/tests/xmlfiles/20-rule-bitwise.xml
@@ -3,6 +3,7 @@
   <expr type="bitwise">
     <sreg>2</sreg>
     <dreg>2</dreg>
+    <len>16</len>
     <mask>
       <data_reg type="value">
         <len>16</len>


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

end of thread, other threads:[~2013-07-08 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-08 11:52 [libnftables PATCH] bitwise: xml: export len node Arturo Borrero Gonzalez
2013-07-08 17:00 ` Pablo Neira Ayuso

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