<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Updating and destroying set elements"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1725">1725</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Updating and destroying set elements
</td>
</tr>
<tr>
<th>Product</th>
<td>nftables
</td>
</tr>
<tr>
<th>Version</th>
<td>1.0.x
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P5
</td>
</tr>
<tr>
<th>Component</th>
<td>nft
</td>
</tr>
<tr>
<th>Assignee</th>
<td>pablo@netfilter.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>xnoreq@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>nftables 1.0.9
Archlinux 6.5.9-arch2-1
Currently, it does not seem to be possible to update elements for a set defined
like this:
table ip raw {
set BLACKLIST {
type ipv4_addr
size 1024
timeout 30d
}
}
with something like:
nft update element ip raw BLACKLIST '{ a.b.c.d timeout 10s }'
Instead, a hack like this is required:
nft add element ip raw BLACKLIST '{ a.b.c.d }'
nft delete element ip raw BLACKLIST '{ a.b.c.d }'
nft add element ip raw BLACKLIST '{ a.b.c.d timeout 10s }'
The delete is required such that the add can set the updated timeout.
The first add is necessary to prevent delete from failing in case the element
did not exist before.
Can we have an update command please? That would make this a lot easier.
Also, there seems to be a "destroy" for entire sets. Imo, it would also make
sense to have the same for set elements, like so:
nft destroy element ip raw BLACKLIST '{ a.b.c.d }'
Interestingly, in chapter SETS the man page specifies
{add | delete | destroy} element
but this fails if the element does not exist:
nft destroy element ip raw BLACKLIST '{ a.b.c.d }'
Error: Could not process rule: No such file or directory
destroy element ip raw BLACKLIST { a.b.c.d }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In the chapter elements the man page specifies
{add | create | delete | destroy | get | reset } element
but does not describe most of these operations.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>