]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink: fix element addition to map with stateful object
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 17 Oct 2017 10:25:00 +0000 (12:25 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 17 Oct 2017 12:03:43 +0000 (14:03 +0200)
commit0d2b22cbd57b2f0c617e0bdd5a0c8d2dce284882
tree1cd38197079a2789ebcc2642bb28775fe7f8a116
parent64b7edd8d5812cac7f361c58dadcbedbaa4898e6
netlink: fix element addition to map with stateful object

Expressions with EXPR_F_INTERVAL_END flag set on have no right hand side,
so they store no stateful object. Skip them so we don't crash on this.

 # nft add map x testmap { type inet_service: counter\; flags interval\;}
 # nft add counter x testcounter
 # nft add element x testmap { 0-100 : "testcounter" }
 Segmentation fault

This patch also fixes the listing codepath.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1190
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c