mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-21 14:32:57 +03:00
Compare commits
1 Commits
3444bf978c
...
3c2f18b2be
Author | SHA1 | Date | |
---|---|---|---|
|
3c2f18b2be |
12
nfq/nfqws.c
12
nfq/nfqws.c
@ -217,12 +217,10 @@ static bool nfq_init(struct nfq_handle **h,struct nfq_q_handle **qh)
|
||||
if (!rawsend_preinit(params.bind_fix4,params.bind_fix6))
|
||||
goto exiterr;
|
||||
|
||||
int yes=1, fd = nfq_fd(*h);
|
||||
|
||||
#if defined SOL_NETLINK && defined NETLINK_NO_ENOBUFS
|
||||
if (setsockopt(fd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &yes, sizeof(yes)) == -1)
|
||||
DLOG_PERROR("setsockopt(NETLINK_NO_ENOBUFS)");
|
||||
#endif
|
||||
// increase socket buffer size. on slow systems reloading hostlist can take a while.
|
||||
// if too many unhandled packets are received its possible to get "no buffer space available" error
|
||||
if (!set_socket_buffers(nfq_fd(*h),Q_RCVBUF/2,Q_SNDBUF/2))
|
||||
goto exiterr;
|
||||
|
||||
return true;
|
||||
exiterr:
|
||||
@ -269,7 +267,7 @@ static int nfq_main(void)
|
||||
errno=e;
|
||||
DLOG_PERROR("recv");
|
||||
// do not fail on ENOBUFS
|
||||
} while(e==ENOBUFS);
|
||||
} while(errno==ENOBUFS);
|
||||
|
||||
nfq_deinit(&h,&qh);
|
||||
|
||||
|
@ -711,12 +711,10 @@ void parse_params(int argc, char *argv[])
|
||||
while ((v = getopt_long_only(argc, argv, "", long_options, &option_index)) != -1)
|
||||
{
|
||||
if (v)
|
||||
{
|
||||
if (bDry)
|
||||
exit_clean(1);
|
||||
else
|
||||
exithelp_clean();
|
||||
}
|
||||
switch (option_index)
|
||||
{
|
||||
case 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user