From: W.C.A. Wijngaards Date: Wed, 31 Aug 2022 14:45:15 +0000 (+0200) Subject: - Fix for wait for udp send to stop when packet is successfully sent. X-Git-Tag: release-1.17.0rc1~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f5cc259747256b37a0706294328d0d443dea403;p=thirdparty%2Funbound.git - Fix for wait for udp send to stop when packet is successfully sent. --- diff --git a/doc/Changelog b/doc/Changelog index 212df9a88..2ea68e1a2 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,7 @@ blocking socket operations. - Fix to wait for blocked write on UDP sockets, with a timeout if it takes too long the packet is dropped. + - Fix for wait for udp send to stop when packet is successfully sent. 22 August 2022: Wouter - Fix #741: systemd socket activation fails on IPv6. diff --git a/util/netevent.c b/util/netevent.c index cf9a38f61..9c5fb3af3 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -388,7 +388,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, #endif /* if we set the fd blocking, other threads suddenly * have a blocking fd that they operate on */ - while( + while(sent == -1 && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -401,7 +401,7 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK #endif - ) { + )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) struct pollfd p; int pret; @@ -624,7 +624,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK) { #endif - while( + while(sent == -1 && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -637,7 +637,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK #endif - ) { + )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) struct pollfd p; int pret;