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_match-test.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'tests/nft-expr_match-test.c') diff --git a/tests/nft-expr_match-test.c b/tests/nft-expr_match-test.c index 96b063a..784f2b2 100644 --- a/tests/nft-expr_match-test.c +++ b/tests/nft-expr_match-test.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,7 @@ int main(int argc, char *argv[]) char buf[4096]; struct nft_rule_expr_iter *iter_a, *iter_b; struct nft_rule_expr *rule_a, *rule_b; - struct xt_iprange_mtinfo *info; + char data[16] = "0123456789abcdef"; a = nft_rule_alloc(); b = nft_rule_alloc(); @@ -72,17 +71,7 @@ int main(int argc, char *argv[]) nft_rule_expr_set_str(ex, NFT_EXPR_MT_NAME, "Tests"); nft_rule_expr_set_u32(ex, NFT_EXPR_MT_REV, 0x12345678); - - info = calloc(1, sizeof(struct xt_iprange_mtinfo)); - if (info == NULL) - print_err("OOM"); - - info->src_min.ip = info->dst_min.ip = inet_addr("127.0.0.1"); - info->src_max.ip = info->dst_max.ip = inet_addr("127.0.0.1"); - info->flags = IPRANGE_SRC; - - nft_rule_expr_set(ex, NFT_EXPR_MT_INFO, info, sizeof(info)); - + nft_rule_expr_set(ex, NFT_EXPR_MT_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