Commit 73819362 authored by Michał Kępień's avatar Michał Kępień
Browse files

[master] Simplify handling isc_socket_sendto2() return values when flags == 0

4865.	[cleanup]	Simplify handling isc_socket_sendto2() return values.
			[RT #46986]
parent ed9fea3a
4865. [cleanup] Simplify handling isc_socket_sendto2() return values.
[RT #46986]
4864. [bug] named acting as a slave for a catalog zone crashed if
the latter contained a master definition without an IP
address. [RT #45999]
......
......@@ -450,8 +450,7 @@ req_send(dns_request_t *request, isc_task_t *task,
request->flags |= DNS_REQUEST_F_SENDING;
result = isc_socket_sendto2(sock, &r, task, address, NULL,
sendevent, 0);
if (result != ISC_R_SUCCESS)
request->flags &= ~DNS_REQUEST_F_SENDING;
INSIST(result == ISC_R_SUCCESS);
return (result);
}
......
......@@ -2337,7 +2337,6 @@ resquery_send(resquery_t *query) {
dns_compress_t cctx;
isc_boolean_t cleanup_cctx = ISC_FALSE;
isc_boolean_t secure_domain;
isc_boolean_t connecting = ISC_FALSE;
isc_boolean_t tcp = ISC_TF((query->options & DNS_FETCHOPT_TCP) != 0);
dns_ednsopt_t ednsopts[DNS_EDNSOPTIONS];
unsigned ednsopt = 0;
......@@ -2783,7 +2782,6 @@ resquery_send(resquery_t *query) {
query);
if (result != ISC_R_SUCCESS)
goto cleanup_message;
connecting = ISC_TRUE;
query->connects++;
}
}
......@@ -2810,19 +2808,7 @@ resquery_send(resquery_t *query) {
result = isc_socket_sendto2(sock, &r, task, address, NULL,
&query->sendevent, 0);
if (result != ISC_R_SUCCESS) {
if (connecting) {
/*
* This query is still connecting.
* Mark it as canceled so that it will just be
* cleaned up when the connected event is received.
* Keep fctx around until the event is processed.
*/
query->fctx->nqueries++;
query->attributes |= RESQUERY_ATTR_CANCELED;
}
goto cleanup_message;
}
INSIST(result == ISC_R_SUCCESS);
query->sends++;
......
......@@ -387,7 +387,7 @@ ATF_TC_BODY(udp_dscp_v4, tc) {
recv_dscp_value = 0;
result = isc_socket_sendto2(s1, &r, task, &addr2, NULL, socketevent, 0);
ATF_CHECK_EQ_MSG(result, ISC_R_SUCCESS, "%s",
ATF_REQUIRE_EQ_MSG(result, ISC_R_SUCCESS, "%s",
isc_result_totext(result));
waitfor(&completion);
ATF_CHECK(completion.done);
......@@ -492,7 +492,7 @@ ATF_TC_BODY(udp_dscp_v6, tc) {
recv_dscp_value = 0;
result = isc_socket_sendto2(s1, &r, task, &addr2, NULL, socketevent, 0);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
waitfor(&completion);
ATF_CHECK(completion.done);
ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment