Most of this is refactoring around discouraged patterns, but the warnings found an actual error when what was meant to be leaking a refcounted pktsnip (because the C function is taking ownership of it) only leaked the (Copy, hence the complaint from the linter) pointer, leading to use-after-free / double-free. (A tests was added to catch this).
Set as a draft PR while I'm hunting the remaining warnings.
Most of this is refactoring around discouraged patterns, but the warnings found an actual error when what was meant to be leaking a refcounted pktsnip (because the C function is taking ownership of it) only leaked the (Copy, hence the complaint from the linter) pointer, leading to use-after-free / double-free. (A tests was added to catch this).
Set as a draft PR while I'm hunting the remaining warnings.