Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Mikaël Fourrier" <mikael.fourrier@laposte.net>
To: netfilter@vger.kernel.org
Subject: Add element in set when element already present.
Date: Wed, 6 Apr 2016 13:22:09 +0200	[thread overview]
Message-ID: <704aee2d-ebe7-6a77-0848-b2d3ae614805@laposte.net> (raw)

Hi,

When I add an element in a set and the set already contains the element, 
the command fails with an error. Worse: I try to add multiple elements 
and at least one of these elements is already in the set, the command 
fails without adding any element. Why do you use this semantic? It would 
be more ergonomic if you could just add elements in a set without 
checking its content.

Have a good day,
Mikaël



Example:

```
# nft add set inet filter myset '{ type ipv4_addr; }'

# nft add element inet filter myset '{ 0.0.0.0 }'

# nft add element inet filter myset '{ 0.0.0.0 }'
<cmdline>:1:1-41: Error: Could not process rule: File exists
add element inet filter myset { 0.0.0.0 }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# nft add element inet filter myset '{ 0.0.0.0, 1.1.1.1 }'
<cmdline>:1:1-50: Error: Could not process rule: File exists
add element inet filter myset { 0.0.0.0, 1.1.1.1 }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# nft list set inet filter myset
	set myset {
		type ipv4_addr
		elements = { 0.0.0.0}
	}

```

Expected: no error and the set contains { 0.0.0.0, 1.1.1.1}.

             reply	other threads:[~2016-04-06 11:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 11:22 Mikaël Fourrier [this message]
2016-04-06 12:12 ` Add element in set when element already present Mikaël Fourrier
2016-04-06 12:15 ` Mikaël Fourrier
  -- strict thread matches above, loose matches on Subject: below --
2016-08-23 16:51 Mikaël Fourrier
2016-08-24 14:53 ` Pablo Neira Ayuso
2016-08-24 15:25   ` Yamakaky
2016-08-26  9:09     ` Pablo Neira Ayuso
2016-08-26 17:41       ` Yamakaky
2016-08-23 16:53 Yamakaky
2016-08-23 17:28 ` Roger Price
2016-08-23 19:46   ` Yamakaky
     [not found]     ` <000001d1fd88$03ad1770$0b074650$@verizon.net>
2016-08-24  6:57       ` Yamakaky

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=704aee2d-ebe7-6a77-0848-b2d3ae614805@laposte.net \
    --to=mikael.fourrier@laposte.net \
    --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