From 7d3c279c62de52f7736d284f6ae0b08e2be09236 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Tue, 6 Aug 2013 13:55:33 +0200 Subject: set: xml: use nft_mxml_family_parse Use nft_mxml_family_parse() to parse the family. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/set.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/set.c') 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; -- cgit v1.2.3