From 5bdbde0b919bd73080e8f323950b0a42c42f2b01 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 23 Feb 2025 19:37:53 +0100 Subject: [PATCH] Set socket receive buffer to 1 KB to avoid (near) endless queueing of NTP requests Signed-off-by: DL6ER --- src/ntp/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ntp/server.c b/src/ntp/server.c index cd882bdb0..f2db8188e 100644 --- a/src/ntp/server.c +++ b/src/ntp/server.c @@ -309,6 +309,11 @@ static void *ntp_bind_and_listen(void *param) setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)); #endif + // Set socket receive buffer to 1 KB to avoid (near) endless queueing of + // NTP requests + const int recvbuf = 1024; + setsockopt(s, SOL_SOCKET, SO_RCVBUF, &recvbuf, sizeof(recvbuf)); + // Bind the socket to the NTP port char ipstr[INET6_ADDRSTRLEN + 1]; memset(ipstr, 0, sizeof(ipstr));