diff mbox

[libnftables] set: xml: fix key_type parsing

Message ID 20130904160324.19268.79096.stgit@nfdev.cica.es
State Accepted
Headers show

Commit Message

Arturo Borrero Sept. 4, 2013, 4:03 p.m. UTC
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

Comments

Pablo Neira Ayuso Sept. 5, 2013, 8:53 a.m. UTC | #1
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. UTC | #2
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 Ayuso Sept. 5, 2013, 9:08 a.m. UTC | #3
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
diff mbox

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);