From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, Jan Engelhardt <jengelh@inai.de>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptabes-nft] iptables-nft: allow removal of empty builtin chains
Date: Sun, 15 Aug 2021 15:27:33 +0200 [thread overview]
Message-ID: <20210815132733.GI607@breakpoint.cc> (raw)
In-Reply-To: <20210815131223.GA30503@salvia>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sat, Aug 14, 2021 at 10:53:14PM +0200, Florian Westphal wrote:
> > Indeed. Since this removes the base chain, it implicitly reverts
> > a DROP policy too.
>
> User still has to iptables -F on that given chain before deleting,
> right?
Yes, -X fails if the chain has rules.
> If NLM_F_NONREC is used, the EBUSY is reported when trying to delete
> a chain with rules.
Yes.
> My assumption is that the user will perform:
>
> iptables-nft -F -t filter
> iptables-nft -D -t filter
Yes, assuminy you meant -X instead of -D.
This behaves just like before, it deletes all rules (-F) and all user-defined
chains (-X).
> I mean, by when the user has an empty basechain with default policy to
> DROP, if they remove the chain, then they are really meaning to remove
> the chain and this default policy to DROP.
ATM iptables -X $BUILTIN will always fail.
In -legecy there is no kernel API to allow for its removal,
for -nft there is an extra check that throws an error.
> Or am I missing anything else?
No, I don't think so. I would prefer if
iptables-nft -F -t filter
iptables-nft -X -t filter
... would result in an empty "filter" table.
I could also add a patch that requests removal
of the table as well for the -X case; but unlike base chain the
presence of the table alone has no impact on dataplane.
next prev parent reply other threads:[~2021-08-15 13:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-14 17:46 [PATCH iptabes-nft] iptables-nft: allow removal of empty builtin chains Florian Westphal
2021-08-14 20:18 ` Jan Engelhardt
2021-08-14 20:53 ` Florian Westphal
2021-08-15 13:12 ` Pablo Neira Ayuso
2021-08-15 13:27 ` Florian Westphal [this message]
2021-08-15 13:49 ` Pablo Neira Ayuso
2021-08-15 14:14 ` Florian Westphal
2021-08-15 14:27 ` Pablo Neira Ayuso
2021-08-15 14:36 ` Florian Westphal
2021-09-13 15:46 ` Phil Sutter
2021-09-13 16:02 ` Florian Westphal
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=20210815132733.GI607@breakpoint.cc \
--to=fw@strlen.de \
--cc=jengelh@inai.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.