From: Miroslav Lichvar Date: Mon, 26 Sep 2016 10:24:49 +0000 (+0200) Subject: ntp: use ipi_addr from struct in_pktinfo as local address X-Git-Tag: 3.0-pre1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b536296c05c8b83c307e2c48ab974dcc82fcd86d;p=thirdparty%2Fchrony.git 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. --- diff --git a/ntp_io.c b/ntp_io.c index 5705340e..8fb3c3cd 100644 --- 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