mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-03 04:09:28 -05:00
- For #1300: implement sock-queue-timeout for FreeBSD as well.
This commit is contained in:
parent
444c839474
commit
cb919d5126
4 changed files with 17 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -910,7 +910,7 @@ These options are part of the **server:** clause.
|
|||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -1183,6 +1183,15 @@ set_recvtimestamp(int s)
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -1083,6 +1083,12 @@ comm_point_udp_ancil_callback(int fd, short event, void* arg)
|
|||
} 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 */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue