|
|
|
|
|
by eklitzke
1138 days ago
|
|
I'm not sure if your claim here is correct. The patch is to change call sites like priv->set->use++;
To look like: nf_tables_activate_set(ctx, priv->set);
Where this function is defined as: void nf_tables_activate_set(const struct nft_ctx *ctx, struct nft_set *set) {
if (nft_set_is_anonymous(set))
nft_clear(ctx->net, set);
set->use++;
}
So to me (someone who is not an expert in this code) it looks like the fix is checking if the set has the anonymous flag before changing the reference count. I'm not an expert in this code and I could be mistaken, but I think your claim that this would be fixed by Rust object lifetime checking requires better evidence. |
|
More generally: doing a line-by-line translation from C to Rust is never going to be the best way to make use of the capabilities Rust has that C lacks.