mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
nfqws: require qnum or port
This commit is contained in:
26
nfq/nfqws.c
26
nfq/nfqws.c
@@ -688,6 +688,9 @@ int main(int argc, char **argv)
|
||||
memcpy(params.hostspell, "host", 4); // default hostspell
|
||||
*pidfile = 0;
|
||||
|
||||
#ifdef __linux__
|
||||
params.qnum = -1;
|
||||
#endif
|
||||
params.desync_fwmark = DPI_DESYNC_FWMARK_DEFAULT;
|
||||
params.desync_skip_nosni = true;
|
||||
params.desync_split_pos = 2;
|
||||
@@ -1230,6 +1233,21 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
if (params.qnum<0)
|
||||
{
|
||||
fprintf(stderr, "Need queue number (--qnum)\n");
|
||||
exit_clean(1);
|
||||
}
|
||||
#elif defined(BSD)
|
||||
if (!params.port)
|
||||
{
|
||||
fprintf(stderr, "Need divert port (--port)\n");
|
||||
exit_clean(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
// not specified - use desync_ttl value instead
|
||||
if (params.desync_ttl6 == 0xFF) params.desync_ttl6=params.desync_ttl;
|
||||
if (!AUTOTTL_ENABLED(params.desync_autottl6)) params.desync_autottl6 = params.desync_autottl;
|
||||
@@ -1238,14 +1256,6 @@ int main(int argc, char **argv)
|
||||
if (AUTOTTL_ENABLED(params.desync_autottl6))
|
||||
DLOG("autottl ipv6 %u:%u-%u\n",params.desync_autottl6.delta,params.desync_autottl6.min,params.desync_autottl6.max)
|
||||
|
||||
#ifdef BSD
|
||||
if (!params.port)
|
||||
{
|
||||
fprintf(stderr, "Need port number\n");
|
||||
exit_clean(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!LoadIncludeHostLists())
|
||||
{
|
||||
fprintf(stderr, "Include hostlist load failed\n");
|
||||
|
Reference in New Issue
Block a user