diff options
author | Carlos Falgueras García <carlosfg@riseup.net> | 2016-08-18 17:12:36 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-18 18:16:25 +0200 |
commit | 0cbe60118eafe734de7369783cf1c92f6e0934f1 (patch) | |
tree | 25788d9fbb4e1b3f6a9fcd734f72849592fa6d45 /src/rule.c | |
parent | e35693fd13de771e1e047ffa4f799f72f1446e8d (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 <pablo@netfilter.org>
Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; } |