Skip to contentSkip to conversation

netfilter_queue: multi-thread support

DISCUSSION [email protected] 1 participant 1 message Feb 13, 2012

lore
Share & tools
lore
#0 lore raw

This is a question related to netfilter_queue (user space) and multiple threads:
Can different threads in a single process listen to different (netfilter) queue \
numbers?

Yes they certainly can, I do that in my project.

Should each of the threads peform, separately, nfq_open/nfq_unbind/nfq_bind ? should that be executed only once and then each thread do nfq_create_queue ?

There is no need to perform that by each thread individually. You can perform it in any thread ,e.g. in main()
It should be executed once for each nf queue you create.
nfq_create_queue can be done either in main (that's what I do) or in any other thread(never done that, but there is no reason it shouldn't work)

P.S.
please CC me when replying