<html>
<head>
<base href="https://bugzilla.netfilter.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Set clone functions not exported."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1690#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Set clone functions not exported."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1690">bug 1690</a>
from <span class="vcard"><a class="email" href="mailto:bugs@phlexo.com" title="Phil S <bugs@phlexo.com>"> <span class="fn">Phil S</span></a>
</span></b>
<pre>(In reply to Pablo Neira Ayuso from <a href="show_bug.cgi?id=1690#c5">comment #5</a>)
<span class="quote">> (In reply to Pablo Neira Ayuso from <a href="show_bug.cgi?id=1690#c3">comment #3</a>)
> > why do you need this?
>
> I mean: We currently export function whose primary users are netfilter.org
> projects, why do you need this clone function?
>
> Thanks.</span >
I'm working on a project which uses libnftnl to dynamically make changes to
nftables as needed.
It wraps the objects in c++ classes using RAII to call the applicable alloc and
free functions. In the case of nftnl_set_elem objects, a clone is needed before
calling nftnl_set_elem because it will take ownership of the memory and result
in a double free.
I also have some nftnl_set objects for which I periodically populate the
elements via netlink and iterate them. It would be handy to be able to clone
the object before populating the elements so they don't have to be kept in
memory between updates.
I can add workarounds for the above if you're not comfortable exporting these
functions, but if that's the case they should probably be removed from
include/libnftnl/set.h instead?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>