mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
socket: make all sockets non-blocking
All networking code in chronyd (NTP server/client, signd client, cmdmon server) assumes sending a message will not block, but only the signd client actually checks for a write event and only the NTP server requests a non-blocking socket. The cmdmon server and NTP client (if using one socket for all servers) might be blocked. chronyc doesn't need a non-blocking socket, but it is not expected to block as it sends only one message at a time. Prefer dropped messages over blocking in all cases. Remove the SCK_FLAG_NONBLOCK flag and make all sockets non-blocking.
This commit is contained in:
2
ntp_io.c
2
ntp_io.c
@@ -98,7 +98,7 @@ open_socket(int family, int local_port, int client_only, IPSockAddr *remote_addr
|
||||
|
||||
sock_flags = SCK_FLAG_RX_DEST_ADDR | SCK_FLAG_PRIV_BIND;
|
||||
if (!client_only)
|
||||
sock_flags |= SCK_FLAG_NONBLOCK | SCK_FLAG_BROADCAST;
|
||||
sock_flags |= SCK_FLAG_BROADCAST;
|
||||
|
||||
sock_fd = SCK_OpenUdpSocket(remote_addr, &local_addr, sock_flags);
|
||||
if (sock_fd < 0) {
|
||||
|
||||
Reference in New Issue
Block a user