summaryrefslogtreecommitdiffstats
path: root/src/expr/ct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/ct.c')
-rw-r--r--src/expr/ct.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/expr/ct.c b/src/expr/ct.c
index 8014314..13da036 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -192,26 +192,15 @@ static inline int str2ctkey(const char *ctkey)
return -1;
}
-static int nft_rule_expr_ct_xml_parse(struct nft_rule_expr *e, char *xml)
+static int nft_rule_expr_ct_xml_parse(struct nft_rule_expr *e, mxml_node_t *tree)
{
#ifdef XML_PARSING
struct nft_expr_ct *ct = (struct nft_expr_ct *)e->data;
- mxml_node_t *tree = NULL;
mxml_node_t *node = NULL;
uint64_t tmp;
char *endptr;
int key;
- tree = mxmlLoadString(NULL, xml, MXML_OPAQUE_CALLBACK);
- if (tree == NULL)
- return -1;
-
- if (mxmlElementGetAttr(tree, "type") == NULL)
- goto err;
-
- if (strcmp("ct", mxmlElementGetAttr(tree, "type")) != 0)
- goto err;
-
node = mxmlFindElement(tree, tree, "dreg", NULL, NULL,
MXML_DESCEND_FIRST);
if (node == NULL)
@@ -252,10 +241,8 @@ static int nft_rule_expr_ct_xml_parse(struct nft_rule_expr *e, char *xml)
ct->dir = tmp;
e->flags |= (1 << NFT_EXPR_CT_DIR);
- mxmlDelete(tree);
return 0;
err:
- mxmlDelete(tree);
errno = EINVAL;
return -1;
#else