From 3f232d785f1e14a0b1677266530d93f3b534cfaa Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Fri, 17 Jan 2020 20:58:07 +0000 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- tests/nft-expr_bitwise-test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') 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)); -- cgit v1.2.3