]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: use ipi_addr from struct in_pktinfo as local address
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 26 Sep 2016 10:24:49 +0000 (12:24 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 26 Sep 2016 10:40:44 +0000 (12:40 +0200)
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.

ntp_io.c

index 5705340ebf8b3b51984a38b3f86202077cb71616..8fb3c3cd84d7d2a014a860c7b81f31acbcb7530f 100644 (file)
--- a/ntp_io.c
+++ b/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