if (ai->ai_family == AF_INET6)
if (ai->ai_family == PF_INET6)
static struct addrinfo* order_ipv6_first(struct addrinfo *ai){	struct addrinfo* ptr;	struct addrinfo* lastv6 = NULL;	struct addrinfo* tmp;	assert(ai != NULL);	/* Move all ipv6 addresses to the start of the list - keeping	 * them in original order */	if (ai->ai_family == AF_INET6)		lastv6 = ai;	for (ptr = ai; ptr && ptr->ai_next; ptr = ptr->ai_next) {		if (ptr->ai_next->ai_family == AF_INET6) {			tmp = ptr->ai_next;			ptr->ai_next = tmp->ai_next;			if (lastv6) {				tmp->ai_next = lastv6->ai_next;				lastv6->ai_next = tmp;			} else {				tmp->ai_next = ai;				ai = tmp;			}			lastv6 = tmp;		}	}	return ai;}