From 272f086639ee8aaa1b848d2a85fc9eee80fc3cf5 Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 22 Feb 2026 17:31:13 +0300 Subject: [PATCH] nfqws2: optimize nfq buffers --- nfq2/nfqws.c | 2 ++ nfq2/params.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nfq2/nfqws.c b/nfq2/nfqws.c index 1c9d605..e5c0d11 100644 --- a/nfq2/nfqws.c +++ b/nfq2/nfqws.c @@ -365,6 +365,8 @@ static bool nfq_init(struct nfq_handle **h, struct nfq_q_handle **qh, uint8_t *m // dot not fail. not supported in old linuxes <3.6 } + nfnl_rcvbufsiz(nfq_nfnlh(*h), Q_RCVBUF); + int yes = 1, fd = nfq_fd(*h); #if defined SOL_NETLINK && defined NETLINK_NO_ENOBUFS diff --git a/nfq2/params.h b/nfq2/params.h index 8b449ff..a04772f 100644 --- a/nfq2/params.h +++ b/nfq2/params.h @@ -23,7 +23,8 @@ #define RAW_SNDBUF (64*1024) // in bytes -#define Q_MAXLEN 1024 // in packets +#define Q_MAXLEN 4096 // in packets +#define Q_RCVBUF (1024*1024) // in bytes #define HOSTLIST_AUTO_FAIL_THRESHOLD_DEFAULT 3 #define HOSTLIST_AUTO_FAIL_TIME_DEFAULT 60