ntp: check for missing source address after recvmsg()
This commit is contained in:
parent
2577e20f09
commit
d36c522453
1 changed files with 7 additions and 2 deletions
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;
|
||||||
|
|
Loading…
Reference in a new issue