All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Price <roger@rogerprice.org>
To: netfilter@vger.kernel.org
Subject: Re: Add element in set when element already present.
Date: Tue, 23 Aug 2016 19:28:23 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.11.1608231921010.3700@maria> (raw)
In-Reply-To: <cd5537f9-20fa-67ff-fd33-d4d8c6b55b9f@yamaworld.fr>

On Tue, 23 Aug 2016, Yamakaky wrote:

> When I add an element in a set (same with maps) and the set already 
> contains the element, the command fails with an error.

Hi, The current behaviour corresponds to the mathematical definition of a 
set.  But you could always write a simple wrapper which feeds the elements 
one by one to "nft add element" and ignores the error messages for the 
duplicates.

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

The simple wrapper would have your expected behaviour. What would be 
helpful is a specific return code from "nft add element", and from ipset 
for the same error.

Roger


  reply	other threads:[~2016-08-23 17:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 16:53 Add element in set when element already present Yamakaky
2016-08-23 17:28 ` Roger Price [this message]
2016-08-23 19:46   ` Yamakaky
     [not found]     ` <000001d1fd88$03ad1770$0b074650$@verizon.net>
2016-08-24  6:57       ` Yamakaky
  -- 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-04-06 11:22 Mikaël Fourrier
2016-04-06 12:12 ` Mikaël Fourrier
2016-04-06 12:15 ` Mikaël Fourrier

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=alpine.LSU.2.11.1608231921010.3700@maria \
    --to=roger@rogerprice.org \
    --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 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.