Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Yamakaky <yamakaky@yamaworld.fr>
Cc: netfilter@vger.kernel.org
Subject: Re: Add element in set when element already present.
Date: Fri, 26 Aug 2016 11:09:58 +0200	[thread overview]
Message-ID: <20160826090958.GA2050@salvia> (raw)
In-Reply-To: <1f604982-a2b1-e56b-1ebb-e769fde81710@yamaworld.fr>

On Wed, Aug 24, 2016 at 05:25:54PM +0200, Yamakaky wrote:
[...]
> I forgot to tell, but if I remember correctly there is the same problem for
> maps.

This will also work with maps:

# nft add table x
# nft add map x y { type ipv4_addr : ipv4_addr\; }
# nft add element x y { 1.1.1.1 : 2.2.2.2 }
# nft add element x y { 1.1.1.1 : 2.2.2.2 }
# nft create element x y { 1.1.1.1 : 2.2.2.2 }
<cmdline>:1:1-41: Error: Could not process rule: File exists
create element x y { 1.1.1.1 : 2.2.2.2 }

If you specify a different right hand side on the mapping, this hits
EBUSY at this moment if it differs from the initial value:

# nft add element x y { 1.1.1.1 : 2.2.2.3 }
<cmdline>:1:1-38: Error: Could not process rule: Device or resource busy
add element x y { 1.1.1.1 : 2.2.2.3 }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For sets with timeouts, it should be possible to support timeout
refresh in a follow up patch too.

Thanks!

  reply	other threads:[~2016-08-26  9:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 16:51 Add element in set when element already present 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 [this message]
2016-08-26 17:41       ` Yamakaky
  -- strict thread matches above, loose matches on Subject: below --
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
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=20160826090958.GA2050@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter@vger.kernel.org \
    --cc=yamakaky@yamaworld.fr \
    /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