Prevent -iR from running forever if all addresses are excluded

This commit is contained in:
dmiller
2026-08-28 04:03:19 +00:00
parent fe777b1d7c
commit f6d3e28ffd
+7 -1
View File
@@ -464,9 +464,15 @@ bool HostGroupState::get_next_host(struct sockaddr_storage *ss, size_t *sslen, s
}
/* Check exclude list. */
if (!addrset_contains(exclude_group, (const struct sockaddr *) ss)) {
current_group.reject_last_host();
break;
}
else {
current_group.reject_last_host();
if (addrset_matches_all(exclude_group, o.af())) {
error("All %s addresses are excluded!", o.af() == AF_INET ? "IPv4" : "IPv6");
return false;
}
}
} while (true);
return true;