[Bug 9146] ntpd uses wrong IP address in reply to query

bugzilla at busybox.net bugzilla at busybox.net
Thu Sep 15 02:57:15 UTC 2016


https://bugs.busybox.net/show_bug.cgi?id=9146

--- Comment #5 from Stijn Tintel <stijn+busybox at linux-ipv6.be> ---
(In reply to Denys Vlasenko from comment #4)
Turns out this isn't related to missing includes, or IP_PKTINFO not being
defined.

For IPv4, the problem seems to be that to->sa_family is AF_INET6 instead of
AF_INET4. With this change in send_to_from() in libbb/udp_io.c, it works fine:

@@ -70,7 +71,7 @@ send_to_from(int fd, void *buf, size_t l
        msg.msg_flags = flags;

        cmsgptr = CMSG_FIRSTHDR(&msg);
-       if (to->sa_family == AF_INET && from->sa_family == AF_INET) {
+       if (from->sa_family == AF_INET) {
                struct in_pktinfo *pktptr;
                cmsgptr->cmsg_level = IPPROTO_IP;
                cmsgptr->cmsg_type = IP_PKTINFO;


For IPv6, both to->sa_family and from->sa_family are AF_INET6. I'll need to
debug this further, but that'll be for another day.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list