]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
isc_uv_import must pass UV__IPC_SOCKET_XFER_TCP_CONNECTION, not SERVER.
authorWitold Kręcicki <wpk@isc.org>
Tue, 2 Jun 2020 08:39:05 +0000 (10:39 +0200)
committerWitold Krecicki <wpk@isc.org>
Wed, 3 Jun 2020 20:08:54 +0000 (20:08 +0000)
As a leftover from old TCP accept code isc_uv_import passed TCP_SERVER
flag when importing a socket on Windows.
Since now we're importing/exporting accepted connections it needs to
pass TCP_CONNECTION flag.

lib/isc/netmgr/uv-compat.c

index 4b6cbd741666cbdf41dd1766b6ab74c055bdf104..536541721f1d4c0e2af57895771595dd5657d6e2 100644 (file)
@@ -72,6 +72,7 @@ isc_uv_export(uv_stream_t *stream, isc_uv_stream_info_t *info) {
        if (xfer_info.delayed_error != 0) {
                return (xfer_info.delayed_error);
        }
+       INSIST(xfer_type == UV__IPC_SOCKET_XFER_TCP_CONNECTION);
        info->type = UV_TCP;
        info->socket_info = xfer_info.socket_info;
        return (0);
@@ -84,7 +85,7 @@ isc_uv_import(uv_stream_t *stream, isc_uv_stream_info_t *info) {
        }
 
        return (uv__tcp_xfer_import(
-               (uv_tcp_t *)stream, UV__IPC_SOCKET_XFER_TCP_SERVER,
+               (uv_tcp_t *)stream, UV__IPC_SOCKET_XFER_TCP_CONNECTION,
                &(uv__ipc_socket_xfer_info_t){
                        .socket_info = info->socket_info }));
 }