nfqws: require qnum or port

This commit is contained in:
bol-van 2024-04-17 09:29:10 +03:00
parent 1e56ad498e
commit 17c64b8690
10 changed files with 18 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -688,6 +688,9 @@ int main(int argc, char **argv)
memcpy(params.hostspell, "host", 4); // default hostspell memcpy(params.hostspell, "host", 4); // default hostspell
*pidfile = 0; *pidfile = 0;
#ifdef __linux__
params.qnum = -1;
#endif
params.desync_fwmark = DPI_DESYNC_FWMARK_DEFAULT; params.desync_fwmark = DPI_DESYNC_FWMARK_DEFAULT;
params.desync_skip_nosni = true; params.desync_skip_nosni = true;
params.desync_split_pos = 2; params.desync_split_pos = 2;
@ -1230,6 +1233,21 @@ int main(int argc, char **argv)
#endif #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 // not specified - use desync_ttl value instead
if (params.desync_ttl6 == 0xFF) params.desync_ttl6=params.desync_ttl; if (params.desync_ttl6 == 0xFF) params.desync_ttl6=params.desync_ttl;
if (!AUTOTTL_ENABLED(params.desync_autottl6)) params.desync_autottl6 = params.desync_autottl; 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)) 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) 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()) if (!LoadIncludeHostLists())
{ {
fprintf(stderr, "Include hostlist load failed\n"); fprintf(stderr, "Include hostlist load failed\n");