ntp: accept packets from unknown sources only from server sockets

This commit is contained in:
Miroslav Lichvar
2014-03-26 11:15:09 +01:00
parent 727bf195d1
commit 91e74c704b
3 changed files with 23 additions and 0 deletions

View File

@@ -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)
{