ntp: use ipi_addr from struct in_pktinfo as local address
Use the ipi_addr field instead of ipi_spec_dst as the local address after recvmsg() to be consistent with the processing of struct in6_pktinfo. This may make a difference for messages from the error queue.
This commit is contained in:
parent
d36c522453
commit
b536296c05
1 changed files with 1 additions and 1 deletions
2
ntp_io.c
2
ntp_io.c
|
@ -582,7 +582,7 @@ process_receive(struct msghdr *hdr, int length, int sock_fd)
|
|||
struct in_pktinfo ipi;
|
||||
|
||||
memcpy(&ipi, CMSG_DATA(cmsg), sizeof(ipi));
|
||||
local_addr.ip_addr.addr.in4 = ntohl(ipi.ipi_spec_dst.s_addr);
|
||||
local_addr.ip_addr.addr.in4 = ntohl(ipi.ipi_addr.s_addr);
|
||||
local_addr.ip_addr.family = IPADDR_INET4;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue