diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2020-01-17 20:58:07 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-01-18 21:23:32 +0100 |
commit | 3f232d785f1e14a0b1677266530d93f3b534cfaa (patch) | |
tree | b890f01199498cc6686830db970689187eedeba9 /tests/nft-expr_bitwise-test.c | |
parent | 3fb5640916acdc413f2f7baccbd27e9e03970717 (diff) |
bitwise: add support for new netlink attributes.
Add code to set and get the new op and data attributes. The existing
boolean bitwise expressions will only use the op attribute.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/nft-expr_bitwise-test.c')
-rw-r--r-- | tests/nft-expr_bitwise-test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/nft-expr_bitwise-test.c b/tests/nft-expr_bitwise-test.c index e37d858..41c0af4 100644 --- a/tests/nft-expr_bitwise-test.c +++ b/tests/nft-expr_bitwise-test.c @@ -39,6 +39,9 @@ static void cmp_nftnl_expr(struct nftnl_expr *rule_a, if (nftnl_expr_get_u32(rule_a, NFTNL_EXPR_BITWISE_SREG) != nftnl_expr_get_u32(rule_b, NFTNL_EXPR_BITWISE_SREG)) print_err("Expr BITWISE_SREG mismatches"); + if (nftnl_expr_get_u32(rule_a, NFTNL_EXPR_BITWISE_OP) != + nftnl_expr_get_u32(rule_b, NFTNL_EXPR_BITWISE_OP)) + print_err("Expr BITWISE_OP mismatches"); if (nftnl_expr_get_u16(rule_a, NFTNL_EXPR_BITWISE_LEN) != nftnl_expr_get_u16(rule_b, NFTNL_EXPR_BITWISE_LEN)) print_err("Expr BITWISE_DREG mismatches"); @@ -73,6 +76,7 @@ int main(int argc, char *argv[]) nftnl_expr_set_u32(ex, NFTNL_EXPR_BITWISE_SREG, 0x12345678); nftnl_expr_set_u32(ex, NFTNL_EXPR_BITWISE_DREG, 0x78123456); + nftnl_expr_set_u32(ex, NFTNL_EXPR_BITWISE_OP, NFT_BITWISE_BOOL); nftnl_expr_set_u32(ex, NFTNL_EXPR_BITWISE_LEN, 0x56781234); nftnl_expr_set(ex, NFTNL_EXPR_BITWISE_MASK, &mask, sizeof(mask)); nftnl_expr_set(ex, NFTNL_EXPR_BITWISE_XOR, &xor, sizeof(xor)); |