From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH nft,v2 2/5] tests: shell: cannot use handle for non-existing rule in kernel
Date: Mon, 17 Jun 2019 19:34:42 +0200 [thread overview]
Message-ID: <20190617173442.m6wwae3pdhda5hue@salvia> (raw)
In-Reply-To: <20190617172653.GW31548@orbyte.nwl.cc>
On Mon, Jun 17, 2019 at 07:26:53PM +0200, Phil Sutter wrote:
> Hey Pablo!
>
> On Mon, Jun 17, 2019 at 07:18:39PM +0200, Pablo Neira Ayuso wrote:
> > This test invokes the 'replace rule ... handle 2' command. However,
> > there are no rules in the kernel, therefore it always fails.
>
> I found the cause for why this stopped working: You forgot to adjust
> rule_evaluate(), what you need is something like this:
>
> diff --git a/src/evaluate.c b/src/evaluate.c
> index ff0888d0c7842..f17bebe4a5f22 100644
> --- a/src/evaluate.c
> +++ b/src/evaluate.c
> @@ -3295,7 +3295,7 @@ static int rule_evaluate(struct eval_ctx *ctx, struct rule *rule,
> }
>
> /* add rules to cache only if it is complete enough to contain them */
> - if (!cache_is_complete(&ctx->nft->cache, CMD_LIST))
> + if (!(ctx->nft->cache.flags & NFT_CACHE_RULE))
> return 0;
Thanks! I'll fix this an send a new version.
next prev parent reply other threads:[~2019-06-17 17:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 17:18 [PATCH nft,v2 1/5] src: remove useless parameter from cache_flush() Pablo Neira Ayuso
2019-06-17 17:18 ` [PATCH nft,v2 2/5] tests: shell: cannot use handle for non-existing rule in kernel Pablo Neira Ayuso
2019-06-17 17:26 ` Phil Sutter
2019-06-17 17:34 ` Pablo Neira Ayuso [this message]
2019-06-17 17:53 ` Pablo Neira Ayuso
2019-06-17 17:18 ` [PATCH nft,v2 3/5] rule: skip cache population from do_command_monitor() Pablo Neira Ayuso
2019-06-17 17:18 ` [PATCH nft,v2 4/5] netlink: remove netlink_list_table() Pablo Neira Ayuso
2019-06-17 17:18 ` [PATCH nft,v2 5/5] src: add cache level flags Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190617173442.m6wwae3pdhda5hue@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).