Patchwork [libnftables,20/21] nat: xml: rename node type to nat_type

login
register
mail settings
Submitter Arturo Borrero
Date June 26, 2013, 11:37 a.m.
Message ID <20130626113720.23511.39084.stgit@nfdev.cica.es>
Download mbox | patch
Permalink /patch/254719/
State Accepted
Headers show

Comments

Arturo Borrero - June 26, 2013, 11:37 a.m.
This patch renames the node <type> to a more explicit <nat_type>.

This will prevent in the future from confusing other <type> nodes from other exprs.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 src/expr/nat.c |   10 +++++-----
 1 file changed, 5 insertions(+), 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

Patch

diff --git a/src/expr/nat.c b/src/expr/nat.c
index 378d053..b81fd81 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -228,8 +228,8 @@  static int nft_rule_expr_nat_xml_parse(struct nft_rule_expr *e, char *xml)
 		return -1;
 	}
 
-	/* Get and set <type>. Mandatory */
-	node = mxmlFindElement(tree, tree, "type", NULL, NULL,
+	/* Get and set <nat_type>. Mandatory */
+	node = mxmlFindElement(tree, tree, "nat_type", NULL, NULL,
 			       MXML_DESCEND_FIRST);
 	if (node == NULL) {
 		mxmlDelete(tree);
@@ -334,11 +334,11 @@  nft_rule_expr_nat_snprintf_xml(char *buf, size_t size,
 
 	/* Is a mandatory element. Provide a default, even empty */
 	if (nat->type == NFT_NAT_SNAT)
-		ret = snprintf(buf, len, "<type>snat</type>");
+		ret = snprintf(buf, len, "<nat_type>snat</nat_type>");
 	else if (nat->type == NFT_NAT_DNAT)
-		ret = snprintf(buf, len, "<type>dnat</type>");
+		ret = snprintf(buf, len, "<nat_type>dnat</nat_type>");
 	else
-		ret = snprintf(buf, len, "<type/>");
+		ret = snprintf(buf, len, "<nat_type/>");
 
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);