netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Eric Garver <egarver@redhat.com>
Subject: Re: [PATCH nft 2/2] rule: expand standalone chain that contains rules
Date: Tue, 21 Feb 2023 19:00:53 +0100	[thread overview]
Message-ID: <Y/UG1YXQRIEH8nVj@orbyte.nwl.cc> (raw)
In-Reply-To: <20230206142841.594538-2-pablo@netfilter.org>

Hi Pablo,

On Mon, Feb 06, 2023 at 03:28:41PM +0100, Pablo Neira Ayuso wrote:
> Otherwise rules that this chain contains are ignored when expressed
> using the following syntax:
> 
> chain inet filter input2 {
>        type filter hook input priority filter; policy accept;
>        ip saddr 1.2.3.4 tcp dport { 22, 443, 123 } drop
> }
> 
> and importing chain definitions like these from another file.
> 
> When expanding the chain, remove the rule so the new CMD_OBJ_CHAIN
> case does not expand it again.
> 
> Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1655
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

This commit happens to break a pretty simple use-case:

# nft -f - <<EOF             
flush ruleset                                                                
add table inet t                                          
add chain inet t c { type filter hook input priority 0 ; }
add rule inet t c tcp dport 1234 accept
add rule inet t c accept                          
insert rule inet t c index 1 udp dport 4321 accept
EOF
/dev/stdin:6:30-50: Error: Could not process rule: No such file or directory
insert rule inet t c index 1 udp dport 4321 accept
                             ^^^^^^^^^^^^^^^^^^^^^


      reply	other threads:[~2023-02-21 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 14:28 [PATCH nft 1/2] rule: add helper function to expand chain rules into commands Pablo Neira Ayuso
2023-02-06 14:28 ` [PATCH nft 2/2] rule: expand standalone chain that contains rules Pablo Neira Ayuso
2023-02-21 18:00   ` Phil Sutter [this message]

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=Y/UG1YXQRIEH8nVj@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=egarver@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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).