summaryrefslogtreecommitdiffstats
path: root/src/expr/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/log.c')
-rw-r--r--src/expr/log.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/expr/log.c b/src/expr/log.c
index 8dc5201..b2b3ca1 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -170,25 +170,14 @@ nft_rule_expr_log_parse(struct nft_rule_expr *e, struct nlattr *attr)
return 0;
}
-static int nft_rule_expr_log_xml_parse(struct nft_rule_expr *e, char *xml)
+static int nft_rule_expr_log_xml_parse(struct nft_rule_expr *e, mxml_node_t *tree)
{
#ifdef XML_PARSING
struct nft_expr_log *log = (struct nft_expr_log *)e->data;
- mxml_node_t *tree = NULL;
mxml_node_t *node = NULL;
uint64_t tmp;
char *endptr;
- tree = mxmlLoadString(NULL, xml, MXML_OPAQUE_CALLBACK);
- if (tree == NULL)
- return -1;
-
- if (mxmlElementGetAttr(tree, "type") == NULL)
- goto err;
-
- if (strcmp("log", mxmlElementGetAttr(tree, "type")) != 0)
- goto err;
-
node = mxmlFindElement(tree, tree, "prefix", NULL, NULL,
MXML_DESCEND_FIRST);
if (node == NULL)
@@ -232,11 +221,9 @@ static int nft_rule_expr_log_xml_parse(struct nft_rule_expr *e, char *xml)
log->qthreshold = tmp;
e->flags |= (1 << NFT_EXPR_LOG_QTHRESHOLD);
- mxmlDelete(tree);
return 0;
err:
errno = EINVAL;
- mxmlDelete(tree);
return -1;
#else
errno = EOPNOTSUPP;