Patchwork [libnftables] set: xml: fix key_type parsing

login
register
mail settings
Submitter Arturo Borrero
Date Sept. 4, 2013, 4:03 p.m.
Message ID <20130904160324.19268.79096.stgit@nfdev.cica.es>
Download mbox | patch
Permalink /patch/272660/
State Accepted
Headers show

Comments

Arturo Borrero - Sept. 4, 2013, 4:03 p.m.
Bug introduced by myself at 44928cd5 [set: add XML parsing]

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 0 files changed


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira - Sept. 5, 2013, 8:53 a.m.
On Wed, Sep 04, 2013 at 06:03:25PM +0200, Arturo Borrero Gonzalez wrote:
> Bug introduced by myself at 44928cd5 [set: add XML parsing]

Applied.

Please, investigate why the json/xml test infrastructure did not catch
up this. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arturo Borrero - Sept. 5, 2013, 8:58 a.m.
On 5 September 2013 10:53, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Wed, Sep 04, 2013 at 06:03:25PM +0200, Arturo Borrero Gonzalez wrote:
>> Bug introduced by myself at 44928cd5 [set: add XML parsing]
>
> Applied.
>
> Please, investigate why the json/xml test infrastructure did not catch
> up this. Thanks.

The current testfiles for set uses the same value both in key_type and key_len.

In fact, I discovered this bug using nft-parsing-test, but with
others, additional files.
Pablo Neira - Sept. 5, 2013, 9:08 a.m.
On Thu, Sep 05, 2013 at 10:58:02AM +0200, Arturo Borrero Gonzalez wrote:
> On 5 September 2013 10:53, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Wed, Sep 04, 2013 at 06:03:25PM +0200, Arturo Borrero Gonzalez wrote:
> >> Bug introduced by myself at 44928cd5 [set: add XML parsing]
> >
> > Applied.
> >
> > Please, investigate why the json/xml test infrastructure did not catch
> > up this. Thanks.
> 
> The current testfiles for set uses the same value both in key_type and key_len.

I expected something like this.

> In fact, I discovered this bug using nft-parsing-test, but with
> others, additional files.

I see, I think that including such a test to master would be good.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/src/set.c b/src/set.c
index 1168b54..fe30e77 100644
--- a/src/set.c
+++ b/src/set.c
@@ -458,7 +458,7 @@  static int nft_set_xml_parse(struct nft_set *s, const char *xml)
 	s->flags |= (1 << NFT_SET_ATTR_KEY_TYPE);
 
 	if (nft_mxml_num_parse(tree, "key_len", MXML_DESCEND_FIRST,
-			       BASE_DEC, &s->key_type, NFT_TYPE_U32) != 0)
+			       BASE_DEC, &s->key_len, NFT_TYPE_U32) != 0)
 		goto err;
 
 	s->flags |= (1 << NFT_SET_ATTR_KEY_LEN);