Skip to contentSkip to conversation

Is the libnetfilter_queue thread-safe?

DISCUSSION Jacky Luk 3 participants 3 messages Jan 23, 2009 – Jan 26, 2009 netfilter

lore
Share & tools
lore

Jacky Luk

author
#0 lore raw

Hi,

I would like to ask a question about the libnetfilter_queue. Is the libnetfilter_queue thread-safe? Would the API of libnetfilter_queue cause the kernel crash under multi-threading environment? I am using the Red Hat Enterprise Linux 5.2 with the kernel version 2.6.18-92.el5PAE to develop my own program. The version of libnetfilter_queue is 0.0.16 and the version of libnfnetlink is 0.0.40.

Thanks and Regards,

Jacky Luk

#1 lore raw

Hi,

Quoted 4 lines · Jacky Luk

Hi,

I would like to ask a question about the libnetfilter_queue. Is the libnetfilter_queue thread-safe?

Is had yet to be decide :/ From my experience on NuFW, you can use it with multithreaded programs and you can have a reading thread and a writing thread working together on the same queue.

Quoted 2 lines

Would the API of libnetfilter_queue cause the kernel crash under multi-threading environment?

Clearly not, the worse that can happen is an application crash not a kernel crash.

BR,

Signature · 3 lines
Eric Leblond <[email protected]>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
#2 lore raw
Quoted 10 lines · Eric Leblond

Hi,

Quoted 3 lines · Jacky Luk

Hi,

I would like to ask a question about the libnetfilter_queue. Is the libnetfilter_queue thread-safe?

Is had yet to be decide :/ From my experience on NuFW, you can use it with multithreaded programs and you can have a reading thread and a writing thread working together on the same queue.

I think it should be as long as you don't change anything related to the handle while using it. The remaining parts are merely a stateless communication mechanism, there's no reason why they shouldn't be thread-safe.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html