summaryrefslogtreecommitdiffstats
path: root/tests/nft-expr_match-test.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-08-31 21:53:12 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2014-08-31 22:07:51 +0200
commit93483364369d8ef10d9e38018da02c6b0eae3077 (patch)
tree1d844375bdb5bec58f6725a0ceaf25316d545330 /tests/nft-expr_match-test.c
parentfefd5494d5c23075bd90a41da9961ef8aeab5467 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'tests/nft-expr_match-test.c')
-rw-r--r--tests/nft-expr_match-test.c15
1 files changed, 2 insertions, 13 deletions
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 <netinet/in.h>
#include <netinet/ip.h>
#include <linux/netfilter/nf_tables.h>
-#include <linux/netfilter/xt_iprange.h>
#include <libmnl/libmnl.h>
#include <libnftnl/rule.h>
#include <libnftnl/expr.h>
@@ -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);