Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCannot bind multiple queues #28
Comments
|
It doesn't look like the |
|
Can confirm running into the same problem as @fripSide. Running multiple queues works (per @strictlymike's suggestion), but note that the nfqueue.run() call is blocking (and I don't see a way in the API to signal an exit), so each queue would need to run out of its own thread/process and be killed on exit. Not the cleanest solution unfortunately, but works for now. |
When I try to use netfilter to bind two queue with different queue num, and I add two callbacks methods to bind with the two number.
nfqueue.bind(1, self.in_modify)
nfqueue.bind(2, self.out_modify)
However, the two queues are all bind to the second callback method.
https://github.com/kti/python-netfilterqueue/blob/master/netfilterqueue.pyx#L178
In this line, it's obvious that the pointer user_callback are overwrite when bind another queue. I think here should use a map to support different callbacks for each queue num.