All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH libnftnl 1/5] expr: add and use incomplete tag
Date: Tue, 8 Oct 2024 13:13:32 +0200	[thread overview]
Message-ID: <ZwUT3LGOMW_PPXFr@calendula> (raw)
In-Reply-To: <20241007094943.7544-2-fw@strlen.de>

On Mon, Oct 07, 2024 at 11:49:34AM +0200, Florian Westphal wrote:
> Extend netlink dump decoder functions to set
> expr->incomplete marker if there are unrecognized attributes
> set in the kernel dump.
>
> This can be used by frontend tools to provide a warning to the user
> that the rule dump might be incomplete.

This is to handle old binary and new kernel scenario, correct?

I think it is hard to know if this attribute is fundamental to rise a
warning from libnftnl. It could be just an new attribute that can be
ignored by userspace or not? I think libnftables (higher layer) knows
better what to do in this case, if such new attribute is required or
not.

Or maybe this is a different issue?

> diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
> index e99131a090ed..46346712e462 100644
> --- a/src/expr/bitwise.c
> +++ b/src/expr/bitwise.c
> @@ -97,9 +97,6 @@ static int nftnl_expr_bitwise_cb(const struct nlattr *attr, void *data)
>  	const struct nlattr **tb = data;
>  	int type = mnl_attr_get_type(attr);

Why not simplify with:

	if (mnl_attr_type_valid(attr, NFTA_BITWISE_MAX) < 0) {
		tb[NFTA_BITWISE_UNSPEC] = attr;
		return MNL_CB_OK;
        }

I think it is intentional you are doing this at a later stage.

> -	if (mnl_attr_type_valid(attr, NFTA_BITWISE_MAX) < 0)
> -		return MNL_CB_OK;
> -
>  	switch(type) {
>  	case NFTA_BITWISE_SREG:
>  	case NFTA_BITWISE_DREG:

  reply	other threads:[~2024-10-08 11:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07  9:49 [RFC libnftnl/nft 0/5] nftables: indicate presence of unsupported netlink attributes Florian Westphal
2024-10-07  9:49 ` [PATCH libnftnl 1/5] expr: add and use incomplete tag Florian Westphal
2024-10-08 11:13   ` Pablo Neira Ayuso [this message]
2024-10-08 12:17     ` Florian Westphal
2024-10-08 14:43       ` Pablo Neira Ayuso
2024-10-08 16:11         ` Florian Westphal
2024-10-07  9:49 ` [PATCH libnftnl 2/5] sets: " Florian Westphal
2024-10-07  9:49 ` [PATCH libnftnl 3/5] libnftnl: add api to query dissection state Florian Westphal
2024-10-07  9:49 ` [PATCH nft 4/5] netlink: tell user if libnftnl detected unknown attributes/features Florian Westphal
2024-10-07  9:49 ` [PATCH nft 5/5] sets: inform user when set definition contains unknown attributes Florian Westphal
2024-10-16 17:07 ` [RFC libnftnl/nft 0/5] nftables: indicate presence of unsupported netlink attributes Phil Sutter
2024-10-16 18:34   ` Pablo Neira Ayuso
2024-10-16 19:04     ` Phil Sutter
2024-10-16 19:41       ` Jan Engelhardt
2024-10-16 19:28   ` Jan Engelhardt
2024-10-16 20:05     ` Phil Sutter

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=ZwUT3LGOMW_PPXFr@calendula \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.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.