mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 05:25:07 -05:00
ntp: accept packets from unknown sources only from server sockets
This commit is contained in:
13
ntp_io.c
13
ntp_io.c
@@ -438,6 +438,19 @@ NIO_CloseClientSocket(int sock_fd)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
NIO_IsServerSocket(int sock_fd)
|
||||
{
|
||||
return sock_fd != INVALID_SOCK_FD &&
|
||||
(sock_fd == server_sock_fd4
|
||||
#ifdef HAVE_IPV6
|
||||
|| sock_fd == server_sock_fd6
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
read_from_socket(void *anything)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user