<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:zlpnobody@gmail.com" title="Liping Zhang <zlpnobody@gmail.com>"> <span class="fn">Liping Zhang</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - set add always returns false or otherwise ends evaluation"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1144">bug 1144</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>zlpnobody@gmail.com
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - set add always returns false or otherwise ends evaluation"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1144#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - set add always returns false or otherwise ends evaluation"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1144">bug 1144</a>
from <span class="vcard"><a class="email" href="mailto:zlpnobody@gmail.com" title="Liping Zhang <zlpnobody@gmail.com>"> <span class="fn">Liping Zhang</span></a>
</span></b>
<pre>(In reply to Robert White from <a href="show_bug.cgi?id=1144#c0">comment #0</a>)
<span class="quote">> In the following example the counters should both equal at least 2 but the
> one predicated on the add is zero.</span >
Can you try this patch?
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index 049ad2d..4ce82f8 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -93,7 +93,7 @@ static void nft_dynset_eval(const struct nft_expr *expr,
return;
}
out:
- if (!priv->invert)
+ if (priv->invert)
regs->verdict.code = NFT_BREAK;
}
<span class="quote">> ASIDE: In my humble opinion the target2 set should be empty, as update
> shouldn't add elements, only update them if they are present; but the
> notation in the wiki regarding the only difference between add and update
> being the treatment of the timeouts implies that the set update is working
> correctly or otherwise always returns true.</span >
Actually, "add" and "update" will both add new elements. The biggest difference
between them is that "update" will refresh the timeout of the element, but
"add" will not.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>