diff --git a/binaries/aarch64/nfqws b/binaries/aarch64/nfqws index c6de6013..bc32395a 100755 Binary files a/binaries/aarch64/nfqws and b/binaries/aarch64/nfqws differ diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index a4f5be01..e24b06d9 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/nfqws b/binaries/arm/nfqws index 6c0015d0..d09b9610 100755 Binary files a/binaries/arm/nfqws and b/binaries/arm/nfqws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index ffe7dab4..0bdd5d77 100755 Binary files a/binaries/arm/tpws and b/binaries/arm/tpws differ diff --git a/binaries/freebsd-x64/dvtws b/binaries/freebsd-x64/dvtws index 0568c3a6..3c10eab5 100755 Binary files a/binaries/freebsd-x64/dvtws and b/binaries/freebsd-x64/dvtws differ diff --git a/binaries/freebsd-x64/tpws b/binaries/freebsd-x64/tpws index 702da695..d985e2fb 100755 Binary files a/binaries/freebsd-x64/tpws and b/binaries/freebsd-x64/tpws differ diff --git a/binaries/mac64/tpws b/binaries/mac64/tpws index ad905fae..891bea57 100755 Binary files a/binaries/mac64/tpws and b/binaries/mac64/tpws differ diff --git a/binaries/mips32r1-lsb/nfqws b/binaries/mips32r1-lsb/nfqws index 614b64ce..2433331c 100755 Binary files a/binaries/mips32r1-lsb/nfqws and b/binaries/mips32r1-lsb/nfqws differ diff --git a/binaries/mips32r1-lsb/tpws b/binaries/mips32r1-lsb/tpws index dd8bfb78..f6028026 100755 Binary files a/binaries/mips32r1-lsb/tpws and b/binaries/mips32r1-lsb/tpws differ diff --git a/binaries/mips32r1-msb/nfqws b/binaries/mips32r1-msb/nfqws index 1d3f798a..02242e50 100755 Binary files a/binaries/mips32r1-msb/nfqws and b/binaries/mips32r1-msb/nfqws differ diff --git a/binaries/mips32r1-msb/tpws b/binaries/mips32r1-msb/tpws index f46bb451..2973dbc8 100755 Binary files a/binaries/mips32r1-msb/tpws and b/binaries/mips32r1-msb/tpws differ diff --git a/binaries/mips64r2-msb/nfqws b/binaries/mips64r2-msb/nfqws index 1d1e609b..2715cffe 100755 Binary files a/binaries/mips64r2-msb/nfqws and b/binaries/mips64r2-msb/nfqws differ diff --git a/binaries/mips64r2-msb/tpws b/binaries/mips64r2-msb/tpws index cf3a82e7..c4ea2f4b 100755 Binary files a/binaries/mips64r2-msb/tpws and b/binaries/mips64r2-msb/tpws differ diff --git a/binaries/ppc/nfqws b/binaries/ppc/nfqws index 02e67fa3..76245f78 100755 Binary files a/binaries/ppc/nfqws and b/binaries/ppc/nfqws differ diff --git a/binaries/ppc/tpws b/binaries/ppc/tpws index d64d9723..e1b36be8 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/nfqws b/binaries/x86/nfqws index 32753235..d4e72973 100755 Binary files a/binaries/x86/nfqws and b/binaries/x86/nfqws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index 8c815381..44e661f1 100755 Binary files a/binaries/x86/tpws and b/binaries/x86/tpws differ diff --git a/binaries/x86_64/nfqws b/binaries/x86_64/nfqws index e2325fe4..eb2694e9 100755 Binary files a/binaries/x86_64/nfqws and b/binaries/x86_64/nfqws differ diff --git a/binaries/x86_64/tpws b/binaries/x86_64/tpws index d03720fb..98f55eeb 100755 Binary files a/binaries/x86_64/tpws and b/binaries/x86_64/tpws differ diff --git a/binaries/x86_64/tpws_wsl.tgz b/binaries/x86_64/tpws_wsl.tgz index a76f6a08..27b44391 100644 Binary files a/binaries/x86_64/tpws_wsl.tgz and b/binaries/x86_64/tpws_wsl.tgz differ diff --git a/nfq/desync.c b/nfq/desync.c index 77394049..b050e338 100644 --- a/nfq/desync.c +++ b/nfq/desync.c @@ -225,16 +225,25 @@ static void auto_hostlist_failed(const char *hostname) { DLOG("auto hostlist : fail threshold reached. adding %s to auto hostlist\n", hostname); HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter); - if (!StrPoolAddStr(¶ms.hostlist, hostname)) + + DLOG("auto hostlist : rechecking %s to avoid duplicates\n", hostname); + bool bExcluded=false; + if (!HostlistCheck(params.hostlist, params.hostlist_exclude, hostname, &bExcluded) && !bExcluded) { - fprintf(stderr, "StrPoolAddStr out of memory\n"); - return; - } - if (!append_to_list_file(params.hostlist_auto_filename, hostname)) - { - perror("write to auto hostlist:"); - return; + DLOG("auto hostlist : adding %s\n", hostname); + if (!StrPoolAddStr(¶ms.hostlist, hostname)) + { + fprintf(stderr, "StrPoolAddStr out of memory\n"); + return; + } + if (!append_to_list_file(params.hostlist_auto_filename, hostname)) + { + perror("write to auto hostlist:"); + return; + } } + else + DLOG("auto hostlist : NOT adding %s\n", hostname); } } diff --git a/nfq/pools.c b/nfq/pools.c index 2b378104..785b04d3 100644 --- a/nfq/pools.c +++ b/nfq/pools.c @@ -76,6 +76,7 @@ hostfail_pool * HostFailPoolAdd(hostfail_pool **pp,const char *s,int fail_time) size_t slen = strlen(s); ADD_STR_POOL(hostfail_pool, pp, s, slen) elem->expire = time(NULL) + fail_time; + elem->counter = 0; return elem; } hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s) diff --git a/tpws/pools.c b/tpws/pools.c index 2b378104..785b04d3 100644 --- a/tpws/pools.c +++ b/tpws/pools.c @@ -76,6 +76,7 @@ hostfail_pool * HostFailPoolAdd(hostfail_pool **pp,const char *s,int fail_time) size_t slen = strlen(s); ADD_STR_POOL(hostfail_pool, pp, s, slen) elem->expire = time(NULL) + fail_time; + elem->counter = 0; return elem; } hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s) diff --git a/tpws/tamper.c b/tpws/tamper.c index 33586046..98d50b53 100644 --- a/tpws/tamper.c +++ b/tpws/tamper.c @@ -303,16 +303,25 @@ static void auto_hostlist_failed(const char *hostname) { VPRINT("auto hostlist : fail threshold reached. adding %s to auto hostlist", hostname); HostFailPoolDel(¶ms.hostlist_auto_fail_counters, fail_counter); - if (!StrPoolAddStr(¶ms.hostlist, hostname)) + + VPRINT("auto hostlist : rechecking %s to avoid duplicates", hostname); + bool bExcluded=false; + if (!HostlistCheck(params.hostlist, params.hostlist_exclude, hostname, &bExcluded) && !bExcluded) { - fprintf(stderr, "StrPoolAddStr out of memory\n"); - return; - } - if (!append_to_list_file(params.hostlist_auto_filename, hostname)) - { - perror("write to auto hostlist:"); - return; + VPRINT("auto hostlist : adding %s", hostname); + if (!StrPoolAddStr(¶ms.hostlist, hostname)) + { + fprintf(stderr, "StrPoolAddStr out of memory\n"); + return; + } + if (!append_to_list_file(params.hostlist_auto_filename, hostname)) + { + perror("write to auto hostlist:"); + return; + } } + else + VPRINT("auto hostlist: NOT adding %s", hostname); } }