path: root/src/rule.c
diff options
authorCarlos Falgueras García <>2016-08-18 17:12:36 +0200
committerPablo Neira Ayuso <>2016-08-18 18:16:25 +0200
commit0cbe60118eafe734de7369783cf1c92f6e0934f1 (patch)
tree25788d9fbb4e1b3f6a9fcd734f72849592fa6d45 /src/rule.c
parente35693fd13de771e1e047ffa4f799f72f1446e8d (diff)
rule: Fix comparison between rules if number of expressions differ
Before this patch, comparison between rules with distinct number of expressions indicate that they are equals, however, they are not. Example: r1[e1, e2] == r2[e1, e2, e3] Fix this by checking that the number of expression is the same. Reported-by: Pablo Neira Ayuso <> Signed-off-by: Carlos Falgueras García <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/rule.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index ae7c478..5d0097c 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1102,6 +1102,7 @@ bool nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
e1 = nftnl_expr_iter_next(&it1);
e2 = nftnl_expr_iter_next(&it2);
+ eq &= (!e1 && !e2);
return eq;