netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: netfilter-devel <netfilter-devel@vger.kernel.org>
Cc: ffmancera@riseup.net
Subject: repeated nft set add ignores changed parameters
Date: Fri, 16 Dec 2022 12:16:28 +0100	[thread overview]
Message-ID: <20221216111628.GA8767@breakpoint.cc> (raw)

When re-adding an existing set no error is returned
and any changed parameters are ignored.

$ nft list ruleset | tee A
table ip nat {
     map m {
	typeof meta mark : ip saddr
	flags dynamic,timeout timeout 1h
   }
  }
}
$ $EDITOR $A  # change timeout
grep timeout\   A
timeout 1m
$ nft -f A
$ nft list ruleset|grep timeout\ 
timeout 1h


Is this a bug?  Is there really no alternative than to completely
zap the entire set/map?

Similar issue:
adding set bla, followed by map bla passes without error but 'map bla'
gets ignored.

On a related note, what happened to 'netfilter: nf_tables: add support
to destroy operation':

https://patchwork.ozlabs.org/project/netfilter-devel/patch/20221028100531.58666-1-ffmancera@riseup.net/

?

Some people are (rightfully) complaining that they need to do stupid
'add','delete' (or even add/delete/add!) games.

I don't really mind if we go with new commands (Fernandos patch), if we
change behaviour to ignore -ENOENT errors (in which case does it
makes sense to return an error...?) or if we add a nlmsg flag (kinda
inverse to NLMSG_F_EXCL), but current state is not nice at all.

                 reply	other threads:[~2022-12-16 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221216111628.GA8767@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=ffmancera@riseup.net \
    --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 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).