]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix the way udp_send_direct() is used
authorOndřej Surý <ondrej@sury.org>
Tue, 20 Oct 2020 06:07:44 +0000 (08:07 +0200)
committerEvan Hunt <each@isc.org>
Thu, 22 Oct 2020 18:37:16 +0000 (11:37 -0700)
commitafca2e3b2198eb43a97fe6edb3c5a46915389e09
treeb6030944a00be0970d42b4748a6cbc03d24d83e2
parent417632ebba672f020e4b665fc28dd5be1f6f86b5
Fix the way udp_send_direct() is used

There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.
lib/isc/netmgr/udp.c