From: W.C.A. Wijngaards Date: Wed, 26 Apr 2023 11:49:33 +0000 (+0200) Subject: - Fix for #882: small changes, date updated in Copyright for X-Git-Tag: release-1.18.0rc1~24^2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=144f29638c789fa7118273f4e54fc2c83a5e9db6;p=thirdparty%2Funbound.git - Fix for #882: small changes, date updated in Copyright for util/timeval_func.c and util/timeval_func.h. Man page entries and example entry. --- diff --git a/doc/Changelog b/doc/Changelog index a5fb8460e..4371e3044 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,12 @@ +26 April 2023: Wouter + - Merge #882 from vvfedorenko: Features/dropqueuedpackets, with + sock-queue-timeout option that drops packets that have been in the + socket queue for too long. Added statistics num.queries_timed_out + and query.queue_time_us.max that track the socket queue timeouts. + - Fix for #882: small changes, date updated in Copyright for + util/timeval_func.c and util/timeval_func.h. Man page entries and + example entry. + 19 April 2023: Wouter - Fix for #878: Invalid IP address in unbound.conf causes Segmentation Fault on OpenBSD. diff --git a/doc/example.conf.in b/doc/example.conf.in index 5b7517052..0523bc756 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -274,6 +274,10 @@ server: # Timeout for EDNS TCP keepalive, in msec. # edns-tcp-keepalive-timeout: 120000 + # UDP queries that have waited in the socket buffer for a long time + # can be dropped. Default is 0, disabled. In seconds, such as 3. + # sock-queue-timeout: 0 + # Use systemd socket activation for UDP, TCP, and control sockets. # use-systemd: no diff --git a/doc/unbound-control.8.in b/doc/unbound-control.8.in index 18bfd44d8..8ab221456 100644 --- a/doc/unbound-control.8.in +++ b/doc/unbound-control.8.in @@ -398,6 +398,14 @@ as a cache response was sent. .I threadX.num.expired number of replies that served an expired cache entry. .TP +.I threadX.num.queries_timed_out +number of queries that are dropped because they waited in the UDP socket buffer +for too long. +.TP +.I threadX.query.queue_time_us.max +The maximum wait time for packets in the socket buffer, in microseconds. This +is only reported when sock-queue-timeout is enabled. +.TP .I threadX.num.recursivereplies The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries. .TP @@ -462,6 +470,12 @@ summed over threads. .I total.num.expired summed over threads. .TP +.I total.num.queries_timed_out +summed over threads. +.TP +.I total.query.queue_time_us.max +the maximum of the thread values. +.TP .I total.num.recursivereplies summed over threads. .TP diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in index 79039d58e..33c15e282 100644 --- a/doc/unbound.conf.5.in +++ b/doc/unbound.conf.5.in @@ -505,6 +505,14 @@ configured, and finally to 0 if the number of free buffers falls below A minimum actual timeout of 200 milliseconds is observed regardless of the advertised timeout. .TP +.B sock\-queue\-timeout: \fI\fR +UDP queries that have waited in the socket buffer for a long time can be +dropped. Default is 0, disabled. The time is set in seconds, 3 could be a +good value to ignore old queries that likely the client does not need a reply +for any more. 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. +.TP .B tcp\-upstream: \fI Enable or disable whether the upstream queries use TCP only for transport. Default is no. Useful in tunneling scenarios. If set to no you can specify diff --git a/util/timeval_func.c b/util/timeval_func.c index 83e963dc8..90250e153 100644 --- a/util/timeval_func.c +++ b/util/timeval_func.c @@ -1,7 +1,7 @@ /* * util/timeval_func.c - helpers to work with struct timeval values. * - * Copyright (c) 2007, NLnet Labs. All rights reserved. + * Copyright (c) 2023, NLnet Labs. All rights reserved. * * This software is open source. * @@ -39,6 +39,7 @@ * This file contains helpers to manipulate struct timeval values. */ +#include "config.h" #include "timeval_func.h" /** subtract timers and the values do not overflow or become negative */ diff --git a/util/timeval_func.h b/util/timeval_func.h index afc35c7e9..819d1dd80 100644 --- a/util/timeval_func.h +++ b/util/timeval_func.h @@ -1,7 +1,7 @@ /* - * util/timeval)func.h - definitions of helpers for strcut timeval values. + * util/timeval_func.h - definitions of helpers for struct timeval values. * - * Copyright (c) 2007, NLnet Labs. All rights reserved. + * Copyright (c) 2023, NLnet Labs. All rights reserved. * * This software is open source. *