summaryrefslogtreecommitdiffstats
path: root/src/mxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mxml.c')
-rw-r--r--src/mxml.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mxml.c b/src/mxml.c
index b2cb95e..5e4f022 100644
--- a/src/mxml.c
+++ b/src/mxml.c
@@ -140,15 +140,10 @@ int nft_mxml_data_reg_parse(mxml_node_t *tree, const char *node_name,
node = mxmlFindElement(tree, tree, node_name, NULL, NULL,
MXML_DESCEND_FIRST);
- if (node == NULL || node->child == NULL) {
- if (!(flags & NFT_XML_OPT)) {
- err->error = NFT_PARSE_EMISSINGNODE;
- err->node_name = node_name;
- errno = EINVAL;
- }
- return DATA_NONE;
- }
+ /* It is necessary for the compatibility with cmpdata label. */
+ if (node == NULL || node->child == NULL)
+ node = tree;
return nft_data_reg_xml_parse(data_reg, node, err);
}