All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Milan JEANTON <m.jeanton@newquest.fr>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Problem with flushing nftalbes sets
Date: Thu, 23 Apr 2020 16:34:25 +0200	[thread overview]
Message-ID: <20200423143425.GE32392@breakpoint.cc> (raw)
In-Reply-To: <5a20c054-cf2e-9694-2242-03e1d01cf568@newquest.fr>

Milan JEANTON <m.jeanton@newquest.fr> wrote:
> table ip test {
>         set tmp {
>                 type ipv4_addr
>         }
> }
> 
> I can add elements in my set without any problem, I can also delete them one
> by one.
> 
> The problem I have is that I need to delete all the elements in the tmp set
> and as precised in the manual of nftables I could flush the elements of a
> set:
> 
> SETS
> [...]
> flush    Remove all elements from the specified set.
> 
> But when I use the command to flush my sets, it doesn't work and displays me
> an error message
> 
> nft 'flush set test tmp'
> Error: Could not process rule: Invalid argument
> flush set test tmp
> ^^^^^^^^^^^^^^^^^^^

Its expected to work from Linux 4.10 onwards.

# nft list ruleset
table ip test {
        set tmp {
                type ipv4_addr
                elements = { 1.2.3.4, 5.6.7.8 }
        }
}
# nft flush set test tmp
# nft list ruleset
table ip test {
        set tmp {
                type ipv4_addr
        }
}
# uname -sr
Linux 5.5.17

  reply	other threads:[~2020-04-23 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 14:12 Problem with flushing nftalbes sets Milan JEANTON
2020-04-23 14:34 ` Florian Westphal [this message]
2020-04-23 14:37 ` Laura Garcia

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=20200423143425.GE32392@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=m.jeanton@newquest.fr \
    --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.