libnetfilter_conntrack callbacks and nfct_destroy
I have 2 questions regarding libnetfilter_conntrack please:
- When using nfct_callback_register() and then nfct_query(), is the callback that is subsequently generated a synchronous callback? (It appears to be, I'd just like positive confirmation).
- Should nfct_destroy() be called after each use of nfct_new() to prevent memory leaks? I assume that the answer is yes, but only one of the examples in the source code use it.
Thanks,
Andy
Quoted 5 lines · Andrew Beverley
I have 2 questions regarding
libnetfilter_conntrackplease:- When using
nfct_callback_register()and thennfct_query(), is the callback that is subsequently generated a synchronous callback? (It appears to be, I'd just like positive confirmation).
The callback is invoked if we succesfully receive the reply message from the ctnetlink subsystem.
Quoted 3 lines
- Should
nfct_destroy()be called after each use ofnfct_new()to prevent memory leaks? I assume that the answer is yes, but only one of the examples in the source code use it.
Yes, nfct_new() requires nfct_destroy() afterwards in order to avoid memory leaks.