From 8e63e483240687ee4c4325073d84926e39416bc9 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 4 Jan 2012 17:16:39 +0100 Subject: expect: add nfexp_cmp This patch adds nfexp_cmp that allows you to compare two expectation objects. This includes the extension of test_api for this new function. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/compare.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/conntrack') diff --git a/src/conntrack/compare.c b/src/conntrack/compare.c index f94f1b9..830195f 100644 --- a/src/conntrack/compare.c +++ b/src/conntrack/compare.c @@ -144,9 +144,9 @@ cmp_orig_ipv6_dst(const struct nf_conntrack *ct1, sizeof(struct in6_addr)) == 0); } -static int cmp_orig(const struct nf_conntrack *ct1, - const struct nf_conntrack *ct2, - unsigned int flags) +int __cmp_orig(const struct nf_conntrack *ct1, + const struct nf_conntrack *ct2, + unsigned int flags) { if (!__cmp(ATTR_ORIG_L3PROTO, ct1, ct2, flags, cmp_orig_l3proto)) return 0; @@ -399,10 +399,10 @@ int __compare(const struct nf_conntrack *ct1, { if ((flags & ~(NFCT_CMP_MASK|NFCT_CMP_STRICT)) == NFCT_CMP_ALL) return cmp_meta(ct1, ct2, flags) && - cmp_orig(ct1, ct2, flags) && + __cmp_orig(ct1, ct2, flags) && cmp_repl(ct1, ct2, flags); - if (flags & NFCT_CMP_ORIG && !cmp_orig(ct1, ct2, flags)) + if (flags & NFCT_CMP_ORIG && !__cmp_orig(ct1, ct2, flags)) return 0; if (flags & NFCT_CMP_REPL && !cmp_repl(ct1, ct2, flags)) -- cgit v1.2.3