To: | bind9-public@isc.org |
From: | michal@isc.org |
Date: | Thu, 11 Jan 2018 12:57:39 +0100 |
Subject: | Simplify handling isc_socket_sendto2() return values when flags == 0 |
Commits 54489ba1672 and 67adc03ef8 replaced some isc_socket_sendto()
calls with isc_socket_sendto2() calls without taking into consideration
that the latter cannot fail due to lack of memory, leaving some
redundant code behind.
On Unix systems, isc_socket_sendto2() called with no flags set always
returns ISC_R_SUCCESS.
On Windows systems, isc_socket_sendto2() called with no flags set can
only return a value different than ISC_R_SUCCESS due to a programmatic
error (ISC_R_CONNREFUSED, when the socket is closed).
Thus, we should never really expect anything other than ISC_R_SUCCESS
from isc_socket_sendto2() called with flags == 0. Attempts to handle
such situations are misleading, plus evaluating one such error handling
branch in resquery_send() (introduced for the right reasons in
146057d7e7) actually leads to a crash (since commit adbf81335b).