Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Kerin Millar" <kfm@plushkava.net>
To: Eric <evil.function@proton.me>
Cc: Slavko <linux@slavino.sk>, "netfilter ML" <netfilter@vger.kernel.org>
Subject: Re: Sets update
Date: Sun, 21 Jul 2024 17:46:41 +0100	[thread overview]
Message-ID: <25712e6c-a8ec-4b90-a3f5-9598f2732a73@app.fastmail.com> (raw)
In-Reply-To: <IaAIguFhd9166N8ahepxBr7RDvjeW_BR2R0yuNXw0bCEGePrIv2hmcAPU6J2PM6JciU1Rd3YaqzqRA75zSf8OliDMf-gqNetZkmd-3SNHf4=@proton.me>

On Sun, 21 Jul 2024, at 5:09 PM, Eric wrote:
> On Sunday, July 21st, 2024 at 02:58, Kerin Millar <kfm@plushkava.net> wrote:
>> As far as I am aware, it is impossible to add elements in a way that merely reset their expiry times in the case that they exist
>
> 'reset element' was added in 1.0.8, but requires kernel 6.5 or later:
>
> nft add   element inet xyz set_ipv4 '{ 1.0.0.1 expires 1h }'
> sleep 10
> nft reset element inet xyz set_ipv4 '{ 1.0.0.1 }'
> nft get   element inet xyz set_ipv4 '{ 1.0.0.1 }'
>
> See https://bugzilla.netfilter.org/show_bug.cgi?id=1689

Thank you. Putting aside my disappointment that the terminology shall now forever be disjoint with that employed by packet path updates, it appears to be a broken feature.

# nft -v; uname -r; nft list ruleset
nftables v1.0.9 (Old Doc Yak #3)
6.6.36-1-lts
table ip filter {
        set x {
                type ipv4_addr
                size 65536
                flags dynamic,timeout
                timeout 1h
                elements = { 1.2.3.4 expires 57m38s723ms }
        }
}
# nft 'reset element ip filter x { 1.2.3.4 }'
table ip filter {
        set x {
                type ipv4_addr
                size 65536
                flags dynamic,timeout
                timeout 1h
                elements = { 1.2.3.4 expires 56m37s83ms }
        }
}
# nft list ruleset
table ip filter {
        set x {
                type ipv4_addr
                size 65536
                flags dynamic,timeout
                timeout 1h
                elements = { 1.2.3.4 expires 56m5s366ms }
        }
}

Further, defining the initial timeout on a per-element basis has no impact on the proceedings here, nor does defining a new timeout and/or expires value in the course of issuing the reset command.

An additional problem with it is that it raises an error in the case that the specified element does not already exist, just as delete does. So, even if it were working as intended, it would continue to fall short of achieving feature parity with ipset(8).

--
Kerin Millar

  reply	other threads:[~2024-07-21 16:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  7:44 Sets update Slavko
2024-07-21  9:58 ` Kerin Millar
2024-07-21 10:04   ` Kerin Millar
2024-07-21 11:23   ` Slavko
2024-07-21 12:29     ` Kerin Millar
2024-07-21 14:38       ` Slavko
2024-07-21 15:46         ` Kerin Millar
2024-07-23  7:24       ` Slavko
2024-07-23  7:37         ` Slavko
2024-07-23  9:39         ` Pablo Neira Ayuso
2024-07-23 10:23           ` Slavko
2024-07-23 11:32           ` Kerin Millar
2024-07-23 12:19             ` Pablo Neira Ayuso
2024-07-21 16:09   ` Eric
2024-07-21 16:46     ` Kerin Millar [this message]
2024-07-21 17:58   ` Slavko
2024-07-22 20:36   ` Pablo Neira Ayuso
2024-07-23  7:26     ` Slavko

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=25712e6c-a8ec-4b90-a3f5-9598f2732a73@app.fastmail.com \
    --to=kfm@plushkava.net \
    --cc=evil.function@proton.me \
    --cc=linux@slavino.sk \
    --cc=netfilter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox