diff --git a/binaries/aarch64/nfqws b/binaries/aarch64/nfqws index c6de601..bc32395 100755 Binary files a/binaries/aarch64/nfqws and b/binaries/aarch64/nfqws differ diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index a4f5be0..e24b06d 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/nfqws b/binaries/arm/nfqws index 6c0015d..d09b961 100755 Binary files a/binaries/arm/nfqws and b/binaries/arm/nfqws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index ffe7dab..0bdd5d7 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 0568c3a..3c10eab 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 702da69..d985e2f 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 ad905fa..891bea5 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 614b64c..2433331 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 dd8bfb7..f602802 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 1d3f798..02242e5 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 f46bb45..2973dbc 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 1d1e609..2715cff 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 cf3a82e..c4ea2f4 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 02e67fa..76245f7 100755 Binary files a/binaries/ppc/nfqws and b/binaries/ppc/nfqws differ diff --git a/binaries/ppc/tpws b/binaries/ppc/tpws index d64d972..e1b36be 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/nfqws b/binaries/x86/nfqws index 3275323..d4e7297 100755 Binary files a/binaries/x86/nfqws and b/binaries/x86/nfqws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index 8c81538..44e661f 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 e2325fe..eb2694e 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 d03720f..98f55ee 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 a76f6a0..27b4439 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 7739404..b050e33 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 2b37810..785b04d 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 2b37810..785b04d 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 3358604..98d50b5 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); } }