libipq and threads

Frank Abel Cancio Bello FRANKABEL at tesla.cujae.edu.cu
Sat Apr 2 05:35:54 CEST 2005


Hi all!

Using QUEUE target I pretend mangle some type of packet(the first packets 
for each flow), but for modify each packet I need a lot of processing. If I 
make all in a single thread in some situation(burst of packet to mangle) the 
delay of packets might up.

Then I think raise one thread for mangle each packet and in this thread call 
the function 
"ipq_set_verdict" with the new payload. I look and find 
"https://lists.netfilter.org/pipermail/netfilter/2003-October/047422.html"

Due to libipq isn't thread-safe I must copy the payload of each packet and 
pass it to the new 
thread in order to avoid rewrite it when arrive a new packet while I'm 
changing the previous 
packet payload. See 
http://www.experts-exchange.com/Programming/Programming_Platforms/Linux_Programming/Q_20766491.html

My question is:
Exist other precaution that I must take?

Thank in advance

Frank







More information about the netfilter mailing list