251 |
/* If we need an IPv4 socket, and don't have one, open it. */ |
/* If we need an IPv4 socket, and don't have one, open it. */ |
252 |
if (need_v4 && !s_active(&res_socket_v4)) |
if (need_v4 && !s_active(&res_socket_v4)) |
253 |
{ |
{ |
254 |
int fd = os_socket(SOCK_DGRAM, AF_INET); |
int fd = os_socket(SOCK_DGRAM, AF_INET, "Resolver UDPv4 socket"); |
255 |
if (fd >= 0) |
if (fd >= 0) |
256 |
socket_add(&res_socket_v4, res_readreply, NULL, |
socket_add(&res_socket_v4, res_readreply, NULL, |
257 |
SS_DATAGRAM, SOCK_EVENT_READABLE, fd); |
SS_DATAGRAM, SOCK_EVENT_READABLE, fd); |
260 |
/* If we need an IPv6 socket, and don't have one, open it. */ |
/* If we need an IPv6 socket, and don't have one, open it. */ |
261 |
if (need_v6 && !s_active(&res_socket_v6)) |
if (need_v6 && !s_active(&res_socket_v6)) |
262 |
{ |
{ |
263 |
int fd = os_socket(SOCK_DGRAM, AF_INET6); |
int fd = os_socket(SOCK_DGRAM, AF_INET6, "Resolver UDPv6 socket"); |
264 |
if (fd >= 0) |
if (fd >= 0) |
265 |
socket_add(&res_socket_v6, res_readreply, NULL, |
socket_add(&res_socket_v6, res_readreply, NULL, |
266 |
SS_DATAGRAM, SOCK_EVENT_READABLE, fd); |
SS_DATAGRAM, SOCK_EVENT_READABLE, fd); |