+ struct sockaddr_in6 *ip6vhost = NULL;
+ if (client->bind && !getaddrinfo(client->bind, NULL, &hints, &res)) {
+ while (res) {
+ switch (res->ai_family) {
+ case AF_INET6:
+ ip6vhost = (struct sockaddr_in6 *) res->ai_addr;
+ break;
+ }
+ res = res->ai_next;
+ }
+ }
+ if(ip6vhost) {
+ ip6vhost->sin6_family = AF_INET6;
+ ip6vhost->sin6_port = htons(0);
+ bind(sock, (struct sockaddr*)ip6vhost, sizeof(*ip6vhost));
+ }
+