All of lore.kernel.org
 help / color / mirror / Atom feed
* Add element in set when element already present.
@ 2016-08-23 16:51 Mikaël Fourrier
  2016-08-24 14:53 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 12+ messages in thread
From: Mikaël Fourrier @ 2016-08-23 16:51 UTC (permalink / raw)
  To: netfilter

Hi,

When I add an element in a set (same with maps) 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}.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Add element in set when element already present.
@ 2016-08-23 16:53 Yamakaky
  2016-08-23 17:28 ` Roger Price
  0 siblings, 1 reply; 12+ messages in thread
From: Yamakaky @ 2016-08-23 16:53 UTC (permalink / raw)
  To: netfilter

Hi,

When I add an element in a set (same with maps) 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}.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Add element in set when element already present.
@ 2016-04-06 11:22 Mikaël Fourrier
  2016-04-06 12:12 ` Mikaël Fourrier
  2016-04-06 12:15 ` Mikaël Fourrier
  0 siblings, 2 replies; 12+ messages in thread
From: Mikaël Fourrier @ 2016-04-06 11:22 UTC (permalink / raw)
  To: netfilter

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}.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-08-26 17:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.