mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 02:25:07 -05:00
ntp: check for missing source address after recvmsg()
This commit is contained in:
5
ntp_io.c
5
ntp_io.c
@@ -565,8 +565,13 @@ process_receive(struct msghdr *hdr, int length, int sock_fd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hdr->msg_namelen >= sizeof (((struct sockaddr *)hdr->msg_name)->sa_family)) {
|
||||||
UTI_SockaddrToIPAndPort((struct sockaddr *)hdr->msg_name,
|
UTI_SockaddrToIPAndPort((struct sockaddr *)hdr->msg_name,
|
||||||
&remote_addr.ip_addr, &remote_addr.port);
|
&remote_addr.ip_addr, &remote_addr.port);
|
||||||
|
} else {
|
||||||
|
remote_addr.ip_addr.family = IPADDR_UNSPEC;
|
||||||
|
remote_addr.port = 0;
|
||||||
|
}
|
||||||
|
|
||||||
local_addr.ip_addr.family = IPADDR_UNSPEC;
|
local_addr.ip_addr.family = IPADDR_UNSPEC;
|
||||||
local_addr.sock_fd = sock_fd;
|
local_addr.sock_fd = sock_fd;
|
||||||
|
|||||||
Reference in New Issue
Block a user