Skip to contentSkip to conversation

nfqueue buf size for recv()

DISCUSSION Oleg 2 participants 3 messages Apr 19, 2017 – Apr 20, 2017 netfilter

lore
Share & tools
lore
maintainer
#1 lore raw
Quoted 6 lines · Oleg

Can anybody tell me how can i determine a right buf size for recv() in libnetfilter_queue program.

http://www.netfilter.org/projects/libnetfilter_queue/doxygen/group__Queue.html#gae36aee5b74d0c88d2f8530e356f68b79

tells nothing about this.

I'd suggest a 80k buffer to be on safe side.

You need to be able to hold the size of one packet, which could be up to 64k depending on options/mtu) plus all the extra netlink meta data.

author
#2 lore raw
Quoted 9 lines · Florian Westphal
Quoted 6 lines · Oleg

Can anybody tell me how can i determine a right buf size for recv() in libnetfilter_queue program.

http://www.netfilter.org/projects/libnetfilter_queue/doxygen/group__Queue.html#gae36aee5b74d0c88d2f8530e356f68b79

tells nothing about this.

I'd suggest a 80k buffer to be on safe side.

My computations give my 70k buffer, but 80k is also suitable. Thanks.

Signature · 1 line
Олег Неманов (Oleg Nemanov)