]> 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 21:59:00 +0000 (14:59 -0700)
commit81085bbeca9dcd16d69017c15d1725c61e32f887
tree18905f47a2e62d13604954e834dd0edef834617f
parent970e1821cc55c138ff9a11c204ff4b79b3b19413
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.

(cherry picked from commit afca2e3b2198eb43a97fe6edb3c5a46915389e09)
lib/isc/netmgr/udp.c