Skip to contentSkip to conversation

libnetfilter_conntrack callbacks and nfct_destroy

DISCUSSION Andrew Beverley 2 participants 2 messages Aug 3, 2010

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 5 lines · Andrew Beverley

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).

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 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.

Yes, nfct_new() requires nfct_destroy() afterwards in order to avoid memory leaks.