Message-ID: Content-Transfer-Encoding: binary Content-Disposition: inline To: bind9-public@isc.org From: michal@isc.org X-Mailer: MIME-tools 5.508 (Entity 5.508) X-RT-Interface: Web Content-Type: text/plain; charset="utf-8" Date: Thu, 11 Jan 2018 12:57:39 +0100 MIME-Version: 1.0 Subject: Simplify handling isc_socket_sendto2() return values when flags == 0 X-RT-Original-Encoding: utf-8 Content-Length: 859 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).