Bug in Netfiler_queue when using small packets in 100Mb traffic
Hi, I encountered a problem with the example nfqnl_test.c when I sent 100Mb/s of <200ko packets. The program stopped running quickly and printed "unbinding from queue 0". It appears that the call recv(fd, buf, sizeof(buf), 0) returns an error after a few packets. (errno 105 : No buffer space available).
Do you see any solution to this problem?
Hi,
Quoted 7 lines · VPF
Hi, I encountered a problem with the example
nfqnl_test.cwhen I sent 100Mb/s of <200ko packets. The program stopped running quickly and printed "unbinding from queue 0". It appears that the callrecv(fd, buf, sizeof(buf), 0)returns an error after a few packets. (errno 105 : No buffer space available).Do you see any solution to this problem?
This problem is well known. This is linked with the size of the nfnetlink buffer. The buffer is too small to contains the data when trafic is high. A typical workaround is to increase this size.
It can be done by using the nfnl_rcvbufsiz(). The code should looks like:
nfnl_rcvbufsiz(nfq_nfnlh(h), SIZE);
This workaround may not be sufficient and in this case a unbinding, rebinding of the queue is needed.
BR,
Signature · 9 lines
Eric Leblond <[email protected]> INL: http://www.inl.fr/ NuFW: http://www.nufw.org/ EdenWall: http://www.edenwall.com/ -- 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
Hi,
Quoted 7 lines · VPF
Hi, I encountered a problem with the example
nfqnl_test.cwhen I sent 100Mb/s of <200ko packets. The program stopped running quickly and printed "unbinding from queue 0". It appears that the callrecv(fd, buf, sizeof(buf), 0)returns an error after a few packets. (errno 105 : No buffer space available).Do you see any solution to this problem?
This problem is well known. This is linked with the size of the nfnetlink buffer. The buffer is too small to contains the data when trafic is high. A typical workaround is to increase this size.
It can be done by using the nfnl_rcvbufsiz(). The code should looks like:
nfnl_rcvbufsiz(nfq_nfnlh(h), SIZE);
This workaround may not be sufficient and in this case a unbinding, rebinding of the queue is needed.
BR,
Signature · 4 lines
Eric Leblond <[email protected]> INL: http://www.inl.fr/ NuFW: http://www.nufw.org/ EdenWall: http://www.edenwall.com/