3 July 2025: Wouter
- Fix #1300: Is 'sock-queue-timeout' a linux only feature.
+ - For #1300: implement sock-queue-timeout for FreeBSD as well.
2 July 2025: Wouter
- Merge #1299: Fix typos.
This could happen if the host has not been able to service the queries for
a while, i.e. Unbound is not running, and then is enabled again.
It uses timestamp socket options.
- The socket option is available on the Linux platform.
+ The socket option is available on the Linux and FreeBSD platforms.
Default: 0 (disabled)
return 0;
}
return 1;
+#elif defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP)
+ int on = 1;
+ /* FreeBSD and also Linux. */
+ if (setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, (void*)&on, (socklen_t)sizeof(on)) < 0) {
+ log_err("setsockopt(..., SO_TIMESTAMP, ...) failed: %s",
+ strerror(errno));
+ return 0;
+ }
+ return 1;
#else
log_err("packets timestamping is not supported on this platform");
(void)s;
} else if( cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SO_TIMESTAMP) {
memmove(&rep.c->recv_tv, CMSG_DATA(cmsg), sizeof(struct timeval));
+#elif defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP)
+ } else if( cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_TIMESTAMP) {
+ /* FreeBSD and also Linux. */
+ memmove(&rep.c->recv_tv, CMSG_DATA(cmsg), sizeof
+(struct timeval));
#endif /* HAVE_LINUX_NET_TSTAMP_H */
}
}