Skip to content

Commit

Permalink
Set socket receive buffer to 1 KB to avoid (near) endless queueing of…
Browse files Browse the repository at this point in the history
… NTP requests

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Feb 23, 2025
1 parent 0d077a5 commit 5bdbde0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ntp/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5bdbde0

Please sign in to comment.