mirror of
https://github.com/bol-van/zapret.git
synced 2026-03-08 06:15:26 +00:00
nfqws: optimize nfq buffers
This commit is contained in:
@@ -256,6 +256,8 @@ static bool nfq_init(struct nfq_handle **h, struct nfq_q_handle **qh)
|
|||||||
// dot not fail. not supported on old linuxes <3.6
|
// dot not fail. not supported on old linuxes <3.6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nfnl_rcvbufsiz(nfq_nfnlh(*h), Q_RCVBUF);
|
||||||
|
|
||||||
DLOG_CONDUP("initializing raw sockets bind-fix4=%u bind-fix6=%u\n", params.bind_fix4, params.bind_fix6);
|
DLOG_CONDUP("initializing raw sockets bind-fix4=%u bind-fix6=%u\n", params.bind_fix4, params.bind_fix6);
|
||||||
if (!rawsend_preinit(params.bind_fix4, params.bind_fix6))
|
if (!rawsend_preinit(params.bind_fix4, params.bind_fix6))
|
||||||
goto exiterr;
|
goto exiterr;
|
||||||
@@ -350,7 +352,7 @@ static int nfq_main(void)
|
|||||||
if (rd)
|
if (rd)
|
||||||
{
|
{
|
||||||
int r = nfq_handle_packet(h, (char *)buf, (int)rd);
|
int r = nfq_handle_packet(h, (char *)buf, (int)rd);
|
||||||
if (r) DLOG_ERR("nfq_handle_packet error %d\n", r);
|
if (r<0) DLOG_ERR("nfq_handle_packet result %d, errno %d : %s\n", r, errno, strerror(errno));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DLOG("recv from nfq returned 0 !\n");
|
DLOG("recv from nfq returned 0 !\n");
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
|
|
||||||
#define RAW_SNDBUF (64*1024) // in bytes
|
#define RAW_SNDBUF (64*1024) // in bytes
|
||||||
|
|
||||||
#define Q_MAXLEN 1024 // in packets
|
#define Q_MAXLEN 4986 // in packets
|
||||||
|
#define Q_RCVBUF (1024*1024) // in bytes
|
||||||
|
|
||||||
#define BADSEQ_INCREMENT_DEFAULT -10000
|
#define BADSEQ_INCREMENT_DEFAULT -10000
|
||||||
#define BADSEQ_ACK_INCREMENT_DEFAULT -66000
|
#define BADSEQ_ACK_INCREMENT_DEFAULT -66000
|
||||||
|
|||||||
Reference in New Issue
Block a user