diff --git a/contrib/blocklist/bin/blacklistd.c b/contrib/blocklist/bin/blacklistd.c --- a/contrib/blocklist/bin/blacklistd.c +++ b/contrib/blocklist/bin/blacklistd.c @@ -185,8 +185,10 @@ return; } - if (getremoteaddress(bi, &rss, &rsl) == -1) + if (getremoteaddress(bi, &rss, &rsl) == -1) { + dbi.last = -1; goto out; + } if (debug) { sockaddr_snprintf(rbuf, sizeof(rbuf), "%a:%p", (void *)&rss); @@ -201,7 +203,6 @@ goto out; } - if (state_get(state, &c, &dbi) == -1) goto out; @@ -265,7 +266,7 @@ out: close(bi->bi_fd); - if (debug) { + if (debug && dbi.last != -1) { char b1[128], b2[128]; (*lfun)(LOG_DEBUG, "%s: final db state for %s: count=%d/%d " "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail,