forked from mirrors/tftp-hpa-google
Support IPv6 on MacOS X systems
Add feature test macros for MacOS X, and don't require IPV6_RECVPKTINFO to exist. Reported-by: YJZ <vollkommen@gmx.net> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
b9708e2201
commit
128e6a3905
2 changed files with 15 additions and 5 deletions
|
@ -222,12 +222,15 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags,
|
|||
|
||||
#ifdef HAVE_STRUCT_IN6_PKTINFO
|
||||
if (cmptr->cmsg_level == IPPROTO_IPV6 &&
|
||||
(cmptr->cmsg_type == IPV6_RECVPKTINFO ||
|
||||
(
|
||||
#ifdef IPV6_RECVPKTINFO
|
||||
cmptr->cmsg_type == IPV6_RECVPKTINFO ||
|
||||
#endif
|
||||
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));
|
||||
memcpy(&pktinfo6, CMSG_DATA(cmptr),
|
||||
sizeof(struct in6_pktinfo));
|
||||
memcpy(&myaddr->s6.sin6_addr, &pktinfo6.ipi6_addr,
|
||||
sizeof(struct in6_addr));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue