Missed a spot for net_family.

This commit is contained in:
Bill Currie 2011-09-03 16:28:00 +09:00
parent 80b2b82092
commit 5ee01879ec
1 changed files with 7 additions and 1 deletions

View File

@ -493,7 +493,13 @@ UDP_OpenSocket (int port)
address.sin6_family = AF_INET6;
memset (&hints, 0, sizeof (hints));
hints.ai_family = PF_UNSPEC;
if (strchr (net_family->string, '6')) {
hints.ai_family = AF_INET6;
} else if (strchr (net_family->string, '4')) {
hints.ai_family = AF_INET;
} else {
hints.ai_family = AF_UNSPEC;
}
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
hints.ai_flags = AI_PASSIVE;