netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org, Florian Westphal <fw@strlen.de>,
	Dan Winship <danwinship@redhat.com>
Subject: Re: [nft PATCH] table: Embed creating nft version into userdata
Date: Thu, 28 Aug 2025 14:53:29 +0200	[thread overview]
Message-ID: <aLBRSR5AXpt5M_7x@calendula> (raw)
In-Reply-To: <20250813170833.28585-1-phil@nwl.cc>

Hi Phil,

I know this is applied, but one late question.

On Wed, Aug 13, 2025 at 07:07:19PM +0200, Phil Sutter wrote:
> @@ -806,6 +815,29 @@ static int table_parse_udata_cb(const struct nftnl_udata *attr, void *data)
>  	return 0;
>  }
>  
> +static int version_cmp(const struct nftnl_udata **ud)
> +{
> +	const char *udbuf;
> +	size_t i;
> +
> +	/* netlink attribute lengths checked by table_parse_udata_cb() */
> +	if (ud[NFTNL_UDATA_TABLE_NFTVER]) {
> +		udbuf = nftnl_udata_get(ud[NFTNL_UDATA_TABLE_NFTVER]);
> +		for (i = 0; i < sizeof(nftversion); i++) {
> +			if (nftversion[i] != udbuf[i])
> +				return nftversion[i] - udbuf[i];
> +		}
> +	}
> +	if (ud[NFTNL_UDATA_TABLE_NFTBLD]) {
> +		udbuf = nftnl_udata_get(ud[NFTNL_UDATA_TABLE_NFTBLD]);
> +		for (i = 0; i < sizeof(nftbuildstamp); i++) {
> +			if (nftbuildstamp[i] != udbuf[i])
> +				return nftbuildstamp[i] - udbuf[i];
> +		}
> +	}

One situation I was considering:

1.0.6.y (build today) in the host
1.1.5 (build n days ago) in the container

This will display the warning.

I suggested to use build time only when version is the same?

If the scenario is nftables in the host injects tables into container,
then host binary will likely be updated more often.

IIUC, the build time here will actually determine when the warning is
emitted, regardless the version.

  parent reply	other threads:[~2025-08-28 12:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 17:07 [nft PATCH] table: Embed creating nft version into userdata Phil Sutter
2025-08-13 17:21 ` Phil Sutter
2025-08-27 22:46 ` Pablo Neira Ayuso
2025-08-28 10:48   ` Phil Sutter
2025-08-28 12:53 ` Pablo Neira Ayuso [this message]
2025-08-28 13:53   ` Phil Sutter
2025-08-28 14:45     ` Pablo Neira Ayuso
2025-09-08 12:03 ` Pablo Neira Ayuso
2025-09-08 12:07   ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2025-08-08 12:46 Phil Sutter
2025-08-11 18:58 ` Pablo Neira Ayuso
2025-08-12 13:06   ` Phil Sutter
2025-08-12 13:17     ` 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=aLBRSR5AXpt5M_7x@calendula \
    --to=pablo@netfilter.org \
    --cc=danwinship@redhat.com \
    --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).