summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>2013-08-06 13:55:33 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-08-06 13:58:49 +0200
commit7d3c279c62de52f7736d284f6ae0b08e2be09236 (patch)
treefc11b79dff1d2581bbb4f92277f3925ecc0a68bb
parent53a2fd88258ea2b413ed4fad081c08aa0edd33e4 (diff)
set: xml: use nft_mxml_family_parse
Use nft_mxml_family_parse() to parse the family. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/set.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/set.c b/src/set.c
index 34cffa2..364e649 100644
--- a/src/set.c
+++ b/src/set.c
@@ -309,7 +309,7 @@ static int nft_set_xml_parse(struct nft_set *s, char *xml)
mxml_node_t *tree;
mxml_node_t *node = NULL;
struct nft_set_elem *elem;
- const char *name, *table, *family_str;
+ const char *name, *table;
int family;
tree = mxmlLoadString(NULL, xml, MXML_OPAQUE_CALLBACK);
@@ -341,12 +341,7 @@ static int nft_set_xml_parse(struct nft_set *s, char *xml)
s->table = strdup(table);
s->flags |= (1 << NFT_SET_ATTR_TABLE);
- family_str = nft_mxml_str_parse(tree, "family", MXML_DESCEND_FIRST);
- if (family_str == NULL)
- goto err;
-
- family = nft_str2family(family_str);
-
+ family = nft_mxml_family_parse(tree, "family", MXML_DESCEND_FIRST);
if (family < 0)
goto err;