Patchwork [libnftables,07/21] nat: xml: change IP range node names

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

Comments

Arturo Borrero - June 26, 2013, 11:37 a.m.
This patch changes the name of XML nodes from <sreg_addr_min_v4> to <sreg_addr_min>,
and <sreg_addr_max_v4> to <sreg_addr_max>, as they are protocol-independent.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 src/expr/nat.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 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 f38011a..7d83154 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -262,8 +262,8 @@  static int nft_rule_expr_nat_xml_parse(struct nft_rule_expr *e, char *xml)
 	nat->family = nft_str2family(node->child->value.opaque);
 	e->flags |= (1 << NFT_EXPR_NAT_FAMILY);
 
-	/* Get and set <sreg_addr_min_v4>. Not mandatory */
-	node = mxmlFindElement(tree, tree, "sreg_addr_min_v4", NULL, NULL,
+	/* Get and set <sreg_addr_min>. Not mandatory */
+	node = mxmlFindElement(tree, tree, "sreg_addr_min", NULL, NULL,
 			       MXML_DESCEND);
 	if (node != NULL) {
 		tmp = strtoull(node->child->value.opaque, &endptr, 10);
@@ -276,8 +276,8 @@  static int nft_rule_expr_nat_xml_parse(struct nft_rule_expr *e, char *xml)
 		e->flags |= (1 << NFT_EXPR_NAT_REG_ADDR_MIN);
 	}
 
-	/* Get and set <sreg_addr_max_v4>. Not mandatory */
-	node = mxmlFindElement(tree, tree, "sreg_addr_max_v4", NULL, NULL,
+	/* Get and set <sreg_addr_max>. Not mandatory */
+	node = mxmlFindElement(tree, tree, "sreg_addr_max", NULL, NULL,
 			       MXML_DESCEND);
 	if (node != NULL) {
 		tmp = strtoull(node->child->value.opaque, &endptr, 10);
@@ -348,8 +348,8 @@  nft_rule_expr_nat_snprintf_xml(char *buf, size_t size,
 
 	if (e->flags & (1 << NFT_EXPR_NAT_REG_ADDR_MIN)) {
 		ret = snprintf(buf+offset, len,
-				"<sreg_addr_min_v4>%u</sreg_addr_min_v4>"
-				"<sreg_addr_max_v4>%u</sreg_addr_max_v4>",
+				"<sreg_addr_min>%u</sreg_addr_min>"
+				"<sreg_addr_max>%u</sreg_addr_max>",
 			       nat->sreg_addr_min, nat->sreg_addr_max);
 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 	}