+++ /dev/null
-#!/bin/sh
-#
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, you can obtain one at https://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-. ../conf.sh
-
-if [ "$(uname -s)" != "Linux" ]; then
- echo_i "This test is currently broken on non-Linux platforms"
- exit 255
-fi
-
-exit 0
static isc_result_t
tcp_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
isc__networker_t *worker = NULL;
+ isc_result_t result = ISC_R_DEFAULT;
int r;
REQUIRE(VALID_NMSOCK(sock));
if (r != 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
if (r != 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
}
if (r != 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_CONNECTFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
atomic_store(&sock->connected, true);
- return (ISC_R_SUCCESS);
-
-failure:
- atomic_store(&sock->active, false);
+done:
+ result = isc__nm_uverr2result(r);
- isc__nm_tcp_close(sock);
+ LOCK(&sock->lock);
+ sock->result = result;
+ SIGNAL(&sock->cond);
+ if (!atomic_load(&sock->active)) {
+ WAIT(&sock->scond, &sock->lock);
+ }
+ INSIST(atomic_load(&sock->active));
+ UNLOCK(&sock->lock);
- return (isc__nm_uverr2result(r));
+ return (result);
}
void
REQUIRE(sock->tid == isc_nm_tid());
result = tcp_connect_direct(sock, req);
- if (result == ISC_R_SUCCESS) {
- atomic_store(&sock->connected, true);
- /* The connect cb will be executed in tcp_connect_cb() */
- } else {
+ if (result != ISC_R_SUCCESS) {
+ atomic_store(&sock->active, false);
+ isc__nm_tcp_close(sock);
isc__nm_uvreq_put(&req, sock);
}
- LOCK(&sock->lock);
- sock->result = result;
- SIGNAL(&sock->cond);
- if (!atomic_load(&sock->active)) {
- WAIT(&sock->scond, &sock->lock);
- }
- INSIST(atomic_load(&sock->active));
- UNLOCK(&sock->lock);
-
/*
* The sock is now attached to the handle.
*/
sock = isc_mem_get(mgr->mctx, sizeof(*sock));
isc__nmsocket_init(sock, mgr, isc_nm_tcpsocket, local);
- atomic_init(&sock->active, false);
sock->extrahandlesize = extrahandlesize;
sock->connect_timeout = timeout;
sock->result = ISC_R_DEFAULT;
(isc__netievent_t *)ievent);
isc__nm_put_netievent_tcpconnect(mgr, ievent);
} else {
+ atomic_init(&sock->active, false);
sock->tid = isc_random_uniform(mgr->nworkers);
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
(isc__netievent_t *)ievent);
if (r < 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
&sock->iface->addr.type.sa, flags);
if (r < 0) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
#else
if (sock->parent->fd == -1) {
if (r < 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
sock->parent->uv_handle.tcp.flags = sock->uv_handle.tcp.flags;
sock->parent->fd = sock->fd;
"uv_listen failed: %s",
isc_result_totext(isc__nm_uverr2result(r)));
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
atomic_store(&sock->listening, true);
-failure:
+done:
result = isc__nm_uverr2result(r);
if (result != ISC_R_SUCCESS) {
sock->pquota = NULL;
static isc_result_t
tcpdns_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
isc__networker_t *worker = NULL;
+ isc_result_t result = ISC_R_DEFAULT;
int r;
REQUIRE(VALID_NMSOCK(sock));
if (r != 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
if (r != 0 && r != UV_EINVAL) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
}
if (r != 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_CONNECTFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
atomic_store(&sock->connected, true);
- return (ISC_R_SUCCESS);
-
-failure:
- atomic_store(&sock->active, false);
+done:
+ result = isc__nm_uverr2result(r);
- isc__nm_tcpdns_close(sock);
+ LOCK(&sock->lock);
+ sock->result = result;
+ SIGNAL(&sock->cond);
+ if (!atomic_load(&sock->active)) {
+ WAIT(&sock->scond, &sock->lock);
+ }
+ INSIST(atomic_load(&sock->active));
+ UNLOCK(&sock->lock);
- return (isc__nm_uverr2result(r));
+ return (result);
}
void
REQUIRE(sock->tid == isc_nm_tid());
result = tcpdns_connect_direct(sock, req);
- if (result == ISC_R_SUCCESS) {
- atomic_store(&sock->connected, true);
- /* The connect cb will be executed in tcpdns_connect_cb() */
- } else {
+ if (result != ISC_R_SUCCESS) {
+ atomic_store(&sock->active, false);
+ isc__nm_tcpdns_close(sock);
isc__nm_uvreq_put(&req, sock);
}
- LOCK(&sock->lock);
- sock->result = result;
- SIGNAL(&sock->cond);
- if (!atomic_load(&sock->active)) {
- WAIT(&sock->scond, &sock->lock);
- }
- INSIST(atomic_load(&sock->active));
- UNLOCK(&sock->lock);
-
/*
* The sock is now attached to the handle.
*/
sock = isc_mem_get(mgr->mctx, sizeof(*sock));
isc__nmsocket_init(sock, mgr, isc_nm_tcpdnssocket, local);
- atomic_init(&sock->active, false);
sock->extrahandlesize = extrahandlesize;
sock->connect_timeout = timeout;
sock->result = ISC_R_DEFAULT;
(isc__netievent_t *)ievent);
isc__nm_put_netievent_tcpdnsconnect(mgr, ievent);
} else {
+ atomic_init(&sock->active, false);
sock->tid = isc_random_uniform(mgr->nworkers);
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
(isc__netievent_t *)ievent);
if (r < 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
&sock->iface->addr.type.sa, flags);
if (r < 0) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
#else
if (sock->parent->fd == -1) {
if (r < 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
sock->parent->uv_handle.tcp.flags = sock->uv_handle.tcp.flags;
sock->parent->fd = sock->fd;
"uv_listen failed: %s",
isc_result_totext(isc__nm_uverr2result(r)));
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
atomic_store(&sock->listening, true);
-failure:
+done:
result = isc__nm_uverr2result(r);
if (result != ISC_R_SUCCESS) {
sock->pquota = NULL;
if (r < 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
uv_bind_flags);
if (r < 0) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
#else
if (sock->parent->fd == -1) {
if (r < 0) {
isc__nm_incstats(sock->mgr,
sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
sock->parent->uv_handle.udp.flags = sock->uv_handle.udp.flags;
sock->parent->fd = sock->fd;
r = uv_udp_recv_start(&sock->uv_handle.udp, udp_alloc_cb, udp_recv_cb);
if (r != 0) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
+ goto done;
}
atomic_store(&sock->listening, true);
-failure:
+done:
result = isc__nm_uverr2result(r);
sock->parent->rchildren += 1;
if (sock->parent->result == ISC_R_DEFAULT) {
udp_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
isc__networker_t *worker = NULL;
int uv_bind_flags = UV_UDP_REUSEADDR;
+ isc_result_t result = ISC_R_DEFAULT;
int r;
REQUIRE(isc__nm_in_netthread());
if (r != 0) {
isc__nm_closesocket(sock->fd);
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPENFAIL]);
- goto failure;
+ goto done;
}
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_OPEN]);
uv_bind_flags);
if (r != 0) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_BINDFAIL]);
- goto failure;
- }
-
- r = isc_uv_udp_connect(&sock->uv_handle.udp, &req->peer.type.sa);
- if (r != 0) {
- isc__nm_incstats(sock->mgr,
- sock->statsindex[STATID_CONNECTFAIL]);
- goto failure;
+ goto done;
}
- isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
- atomic_store(&sock->connecting, false);
#ifdef ISC_RECV_BUFFER_SIZE
uv_recv_buffer_size(&sock->uv_handle.handle,
&(int){ ISC_SEND_BUFFER_SIZE });
#endif
- atomic_store(&sock->connected, true);
+ r = isc_uv_udp_connect(&sock->uv_handle.udp, &req->peer.type.sa);
+ if (r != 0) {
+ isc__nm_incstats(sock->mgr,
+ sock->statsindex[STATID_CONNECTFAIL]);
+ goto done;
+ }
+ isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
- return (ISC_R_SUCCESS);
+ atomic_store(&sock->connecting, false);
+ atomic_store(&sock->connected, true);
-failure:
- atomic_store(&sock->active, false);
+done:
+ result = isc__nm_uverr2result(r);
- isc__nm_udp_close(sock);
+ LOCK(&sock->lock);
+ sock->result = result;
+ SIGNAL(&sock->cond);
+ if (!atomic_load(&sock->active)) {
+ WAIT(&sock->scond, &sock->lock);
+ }
+ INSIST(atomic_load(&sock->active));
+ UNLOCK(&sock->lock);
- return (isc__nm_uverr2result(r));
+ return (result);
}
/*
req->handle = isc__nmhandle_get(sock, &req->peer, &sock->iface->addr);
result = udp_connect_direct(sock, req);
if (result != ISC_R_SUCCESS) {
+ atomic_store(&sock->active, false);
+ isc__nm_udp_close(sock);
isc__nm_uvreq_put(&req, sock);
- }
-
- LOCK(&sock->lock);
- sock->result = result;
- SIGNAL(&sock->cond);
- if (!atomic_load(&sock->active)) {
- WAIT(&sock->scond, &sock->lock);
- }
- INSIST(atomic_load(&sock->active));
- UNLOCK(&sock->lock);
-
- /*
- * The callback has to be called after the socket has been
- * initialized
- */
- if (result == ISC_R_SUCCESS) {
+ } else {
+ /*
+ * The callback has to be called after the socket has been
+ * initialized
+ */
isc__nm_connectcb(sock, req, ISC_R_SUCCESS);
}
sock = isc_mem_get(mgr->mctx, sizeof(isc_nmsocket_t));
isc__nmsocket_init(sock, mgr, isc_nm_udpsocket, local);
- atomic_init(&sock->active, false);
sock->connect_cb = cb;
sock->connect_cbarg = cbarg;
sock->read_timeout = timeout;
(isc__netievent_t *)event);
isc__nm_put_netievent_udpconnect(mgr, event);
} else {
+ atomic_init(&sock->active, false);
sock->tid = isc_random_uniform(mgr->nworkers);
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
(isc__netievent_t *)event);
./bin/tests/system/xferquota/tests.sh SH 2000,2001,2004,2007,2012,2016,2018,2019,2020
./bin/tests/system/zero/ans5/ans.pl PERL 2016,2018,2019,2020
./bin/tests/system/zero/clean.sh SH 2013,2014,2015,2016,2018,2019,2020
-./bin/tests/system/zero/prereq.sh SH 2020
./bin/tests/system/zero/setup.sh SH 2013,2014,2016,2018,2019,2020
./bin/tests/system/zero/tests.sh SH 2013,2016,2017,2018,2019,2020
./bin/tests/system/zonechecks/clean.sh SH 2004,2007,2012,2014,2015,2016,2018,2019,2020