-/* $OpenBSD: res_send_async.c,v 1.27 2015/09/20 14:19:21 eric Exp $ */
+/* $OpenBSD: res_send_async.c,v 1.28 2015/10/18 15:15:00 deraadt Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
{
int errno_save, sock;
- if ((sock = socket(sa->sa_family, socktype | SOCK_NONBLOCK, 0)) == -1)
+ if ((sock = dnssocket(sa->sa_family, socktype | SOCK_NONBLOCK, 0)) == -1)
goto fail;
- if (connect(sock, sa, sa->sa_len) == -1) {
+ if (dnsconnect(sock, sa, sa->sa_len) == -1) {
/*
* In the TCP case, the caller will be asked to poll for
* POLLOUT so that we start writing the packet in tcp_write()