- if (entry && 0 == --entry->attempts) {
- Debug((DEBUG_DNS, "IPcheck noting local connection failure for %s.", ircd_ntoa(&entry->addr)));
- ++entry->attempts;
+ if (entry) {
+ if (0 == --entry->attempts) {
+ Debug((DEBUG_DNS, "IPcheck noting local connection failure for %s.", ircd_ntoa(&entry->addr)));
+ ++entry->attempts;
+ }
+ if (disconnect) {
+ assert(entry->connected > 0);
+ entry->connected--;
+ }