/*
- * Copyright (c) 2007-2016 Apple Inc. All rights reserved.
+ * Copyright (c) 2007-2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
IFA_UNLOCK(ia);
continue;
}
- if ((flags & PFI_AFLAG_NETWORK) && af == AF_INET6 &&
+ if ((af == AF_INET6) &&
IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)
(void *)ia->ifa_addr)->sin6_addr)) {
IFA_UNLOCK(ia);
continue;
}
+ if ((af == AF_INET6) &&
+ (((struct in6_ifaddr *)ia)->ia6_flags &
+ (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY | IN6_IFF_DETACHED |
+ IN6_IFF_CLAT46 | IN6_IFF_TEMPORARY | IN6_IFF_DEPRECATED))) {
+ IFA_UNLOCK(ia);
+ continue;
+ }
if (flags & PFI_AFLAG_NOALIAS) {
if (af == AF_INET && got4) {
IFA_UNLOCK(ia);
"(%d/%d)\n", pfi_buffer_cnt, PFI_BUFFER_MAX);
return;
}
- memcpy(pfi_buffer, p, pfi_buffer_cnt * sizeof(*pfi_buffer));
+ memcpy(p, pfi_buffer, pfi_buffer_max * sizeof(*pfi_buffer));
/* no need to zero buffer */
_FREE(pfi_buffer, PFI_MTYPE);
pfi_buffer = p;