Co-authored-by: Peter van Dijk <peter.van.dijk@powerdns.com>
{
int sendErr = 0;
#ifdef __OpenBSD__
- // OpenBSD can and does return EAGIN on non-blocking datagram sockets
+ // OpenBSD can and does return EAGAIN on non-blocking datagram sockets
for (int i = 0; i < 10; i++) { // Arbitrary upper bound
if (sendmsg(fd, msgh, 0) != -1) {
sendErr = 0;
return ComboAddress(input, port);
}
}
-
#if !defined( __OpenBSD__)
int tries = 10;
#else
- int tries = 2; // hit the reliable kernel random case for OpenBSD immediately, using sysctl net.inet.udp.baddynamic to exclude ports
+ int tries = 2; // hit the reliable kernel random case for OpenBSD immediately (because it will match tries==1 below), using sysctl net.inet.udp.baddynamic to exclude ports
#endif
ComboAddress sin;
while (--tries) {