]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle TCP sockets in isc__nmsocket_reset()
authorOndřej Surý <ondrej@isc.org>
Mon, 28 Feb 2022 09:25:06 +0000 (10:25 +0100)
committerEvan Hunt <each@isc.org>
Mon, 28 Feb 2022 10:06:03 +0000 (02:06 -0800)
The isc__nmsocket_reset() was missing a case for raw TCP sockets (used
by RNDC and DoH) which would case a assertion failure when write timeout
would be triggered.

TCP sockets are now also properly handled in isc__nmsocket_reset().

lib/isc/netmgr/netmgr.c

index 313dba78aec51bfd9cb5c9491d4ed801cc38c8a7..7ede0ec749beb2d3b299c9426ccbddb45aa0f769 100644 (file)
@@ -2851,8 +2851,13 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) {
        REQUIRE(VALID_NMSOCK(sock));
 
        switch (sock->type) {
+       case isc_nm_tcpsocket:
        case isc_nm_tcpdnssocket:
        case isc_nm_tlsdnssocket:
+               /*
+                * This can be called from the TCP write timeout, or
+                * from the TCPDNS or TLSDNS branches of isc_nm_bad_request().
+                */
                REQUIRE(sock->parent == NULL);
                break;
        default: