--- tftpd/recvfrom.c.orig 2014-04-20 08:55:44.000000000 -0400
+++ tftpd/recvfrom.c 2014-04-20 09:00:20.000000000 -0400
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070
+#define __APPLE_USE_RFC_3542 1
#include "config.h" /* Must be included first! */
#include "common/tftpsubs.h"
sizeof(struct in6_addr));
-#ifdef HAVE_STRUCT_IN6_PKTINFO
if (cmptr->cmsg_level == IPPROTO_IPV6 &&
+#if defined(HAVE_STRUCT_IN6_PKTINFO) && defined(IPV6_RECVPKTINFO) /* Some older Darwin platforms require the latter */
(cmptr->cmsg_type == IPV6_RECVPKTINFO ||
- cmptr->cmsg_type == IPV6_PKTINFO)) {
+ cmptr->cmsg_type == IPV6_PKTINFO)) {
memcpy(&pktinfo6, CMSG_DATA(cmptr),
sizeof(struct in6_pktinfo));
memcpy(&myaddr->s6.sin6_addr, &pktinfo6.ipi6_addr,
sizeof(struct in6_addr));