<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - nft add element fails when preceded by nft get element or nft delete element commands"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1451#c9">Comment # 9</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - nft add element fails when preceded by nft get element or nft delete element commands"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1451">bug 1451</a>
from <span class="vcard"><a class="email" href="mailto:oliver@urbanotter.com" title="Oliver O'Boyle <oliver@urbanotter.com>"> <span class="fn">Oliver O'Boyle</span></a>
</span></b>
<pre>Ok, I'm now getting the same results as you mention in <a href="show_bug.cgi?id=1451#c4">comment 4</a>. I tried for
hours to reproduce it as per the logs below, but can't. I'm thinking that I may
have been using a more complex set of instructions that included a 'delete'
command in there when I grabbed the logs. I simplified it after to what I
posted in this bug, however. I say that because I can reproduce the error when
I insert a 'delete' in between the 'get' and 'add'.
This is what I'm using now, and it generates errors on the 'add':
IFS=' ' read -ra TEMP <<< "$RAW_RESULTS"
for j in ${TEMP[*]}; do
nft get element inet filter "$SET" { "$j" }
printf "%s\n" "ATTEMPTED GET OPERATION #1 - get $j from $SET"
nft delete element inet filter "$SET" { "$j" }
printf "%s\n" "ATTEMPTED DEL OPERATION #1 - del $j from $SET"
nft -d eval add element inet filter "$SET" { "$j" }
printf "%s\n" "ATTEMPTED ADD OPERATION #1 - add $j to $SET"
done
Here's a sample set config. They're all the same:
set report_cb_4 {
type ipv4_addr
flags interval,timeout
timeout 1d
elements = { 127.0.0.1 }
}
If you take out the debug command from the 'add', it's easier to follow the
logs. I'm seeing inconsistencies. Sometimes it works, sometimes it doesn't. In
the logs following (in reverse order), you can see the three commands from the
first IP all succeed. In the second IP, the 'add' fails. I can't see any
difference between the two, other than the IP address. And eventually, the one
that failed will usually successfully add its address to the set:
Aug 25 05:21:31 lab-migw bash[255612]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 25 05:21:31 lab-migw bash[255612]: add element inet filter report_r7_4 {
15.223.60.214 }
Aug 25 05:21:31 lab-migw bash[255612]: Error: Could not process rule: File
exists
Aug 25 05:21:31 lab-migw bash[251191]: ATTEMPTED DEL OPERATION #1 - del
15.223.60.214 from report_r7_4
Aug 25 05:21:31 lab-migw bash[251191]: ATTEMPTED GET OPERATION #1 - get
15.223.60.214 from report_r7_4
Aug 25 05:21:31 lab-migw bash[255610]: }
Aug 25 05:21:31 lab-migw bash[255610]: }
Aug 25 05:21:31 lab-migw bash[255610]: elements = {
15.223.60.214 expires 23h59m32s604ms }
Aug 25 05:21:31 lab-migw bash[255610]: timeout 1d
Aug 25 05:21:31 lab-migw bash[255610]: flags interval,timeout
Aug 25 05:21:31 lab-migw bash[255610]: type ipv4_addr
Aug 25 05:21:31 lab-migw bash[255610]: set report_r7_4 {
Aug 25 05:21:31 lab-migw bash[255610]: table inet filter {
Aug 25 05:21:31 lab-migw bash[251191]: ATTEMPTED ADD OPERATION #1 - add
3.96.72.62 to report_r7_4
Aug 25 05:21:31 lab-migw bash[251191]: ATTEMPTED DEL OPERATION #1 - del
3.96.72.62 from report_r7_4
Aug 25 05:21:31 lab-migw bash[251191]: ATTEMPTED GET OPERATION #1 - get
3.96.72.62 from report_r7_4
Aug 25 05:21:31 lab-migw bash[255607]: }
Aug 25 05:21:31 lab-migw bash[255607]: }
Aug 25 05:21:31 lab-migw bash[255607]: elements = { 3.96.72.62
expires 23h59m32s600ms }
Aug 25 05:21:31 lab-migw bash[255607]: timeout 1d
Aug 25 05:21:31 lab-migw bash[255607]: flags interval,timeout
Aug 25 05:21:31 lab-migw bash[255607]: type ipv4_addr
Aug 25 05:21:31 lab-migw bash[255607]: set report_r7_4 {
Aug 25 05:21:31 lab-migw bash[255607]: table inet filter {
I was going to try the kernel patch today but got pulled away. I should be able
to get to it tomorrow.
Oliver</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>