From 93483364369d8ef10d9e38018da02c6b0eae3077 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 31 Aug 2014 21:53:12 +0200 Subject: src: get rid of cached copies of x_tables.h and xt_LOG.h Keeping the full cached copy the of x_tables.h file in tree is too much for just the XT_EXTENSION_MAXNAMELEN constant. Similarly, xt_LOG.h is not actually required by the tests, we can use any whatever syntetic data to make sure the setter and getter provide the same result. So, let's get rid of these headers from the library tree. Signed-off-by: Pablo Neira Ayuso --- tests/nft-expr_target-test.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'tests/nft-expr_target-test.c') diff --git a/tests/nft-expr_target-test.c b/tests/nft-expr_target-test.c index 9387779..838b3fd 100644 --- a/tests/nft-expr_target-test.c +++ b/tests/nft-expr_target-test.c @@ -15,8 +15,6 @@ #include #include #include -#include -#include #include #include #include @@ -57,10 +55,10 @@ int main(int argc, char *argv[]) struct nft_rule *a, *b; struct nft_rule_expr *ex; struct nlmsghdr *nlh; - struct xt_log_info *info; char buf[4096]; struct nft_rule_expr_iter *iter_a, *iter_b; struct nft_rule_expr *rule_a, *rule_b; + char data[16] = "0123456789abcdef"; a = nft_rule_alloc(); b = nft_rule_alloc(); @@ -70,18 +68,10 @@ int main(int argc, char *argv[]) ex = nft_rule_expr_alloc("target"); if (ex == NULL) print_err("OOM"); + nft_rule_expr_set(ex, NFT_EXPR_TG_NAME, "test", strlen("test")); nft_rule_expr_set_u32(ex, NFT_EXPR_TG_REV, 0x12345678); - - info = calloc(1, sizeof(struct xt_log_info)); - if (info == NULL) - print_err("OOM"); - sprintf(info->prefix, "test: "); - info->prefix[sizeof(info->prefix)-1] = '\0'; - info->logflags = 0x0f; - info->level = 5; - nft_rule_expr_set(ex, NFT_EXPR_TG_INFO, info, sizeof(*info)); - + nft_rule_expr_set(ex, NFT_EXPR_TG_INFO, strdup(data), sizeof(data)); nft_rule_add_expr(a, ex); nlh = nft_rule_nlmsg_build_hdr(buf, NFT_MSG_NEWRULE, AF_INET, 0, 1234); -- cgit v1.2.3