From b3e73fda10db2b1aa2ef26690bf285839e4ea22a Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Mon, 5 Aug 2013 14:01:28 +0200 Subject: src: xml: table/chain delete properties This patch deletes the node in chain and table XML objects. For this to work, the first tree search with MXML_DESCEND_FIRST flag is moved to the next node. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/table.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index 402e8c1..76a1b4b 100644 --- a/src/table.c +++ b/src/table.c @@ -244,12 +244,9 @@ static int nft_table_xml_parse(struct nft_table *t, char *xml) t->name = strdup(mxmlElementGetAttr(tree, "name")); t->flags |= (1 << NFT_TABLE_ATTR_NAME); - /* Ignore node */ - node = mxmlFindElement(tree, tree, "properties", NULL, NULL, - MXML_DESCEND_FIRST); - /* Get the and set node */ - node = mxmlFindElement(tree, tree, "family", NULL, NULL, MXML_DESCEND); + node = mxmlFindElement(tree, tree, "family", NULL, NULL, + MXML_DESCEND_FIRST); if (node == NULL) { mxmlDelete(tree); return -1; @@ -363,13 +360,9 @@ static int nft_table_snprintf_json(char *buf, size_t size, struct nft_table *t) static int nft_table_snprintf_xml(char *buf, size_t size, struct nft_table *t) { - return snprintf(buf, size, "" - "" - "%s" - "%d" - "" - "
", - t->name, nft_family2str(t->family), t->table_flags); + return snprintf(buf, size, "%s" + "%d
", + t->name, nft_family2str(t->family), t->table_flags); } static int nft_table_snprintf_default(char *buf, size_t size, struct nft_table *t) -- cgit v1.2.3