path: root/tests
diff options
authorPablo Neira Ayuso <>2016-01-11 19:38:24 +0100
committerPablo Neira Ayuso <>2016-01-13 13:44:53 +0100
commit18bd29733fb67f975fcce1ae8c1aaed22220cd4d (patch)
treef9e06d8c6b97cdf7a7977b9d9fde31b6b49f539b /tests
parent1a3c075be1cf57dc248f38a974a8a01457e6b6e2 (diff)
expr: limit: add support for flags
This patch adds the limit flags, the first client of this is the inversion flag that allows us to match overlimit. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'tests')
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/nft-expr_limit-test.c b/tests/nft-expr_limit-test.c
index bbc82c1..29fb489 100644
--- a/tests/nft-expr_limit-test.c
+++ b/tests/nft-expr_limit-test.c
@@ -43,6 +43,9 @@ static void cmp_nftnl_expr(struct nftnl_expr *rule_a,
if (nftnl_expr_get_u64(rule_a, NFTNL_EXPR_LIMIT_TYPE) !=
nftnl_expr_get_u64(rule_b, NFTNL_EXPR_LIMIT_TYPE))
print_err("Expr TYPE mismatches");
+ if (nftnl_expr_get_u32(rule_a, NFTNL_EXPR_LIMIT_FLAGS) !=
+ nftnl_expr_get_u32(rule_b, NFTNL_EXPR_LIMIT_FLAGS))
+ print_err("Expr FLAGS mismatches");
int main(int argc, char *argv[])
@@ -66,6 +69,7 @@ int main(int argc, char *argv[])
nftnl_expr_set_u64(ex, NFTNL_EXPR_LIMIT_UNIT, 0x123456789abcdef0);
nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_BURST, 0x89123456);
nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_TYPE, 0xdef01234);
+ nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_FLAGS, 0xdef01234);
nftnl_rule_add_expr(a, ex);