[WSD] Add IBWSD_POLL environment variable to allow provider to poll for
[mirror/winof/.git] / ulp / wsd / user / ibsp_duplicate.c
index 9258da4..6a1d0ad 100644 (file)
@@ -57,7 +57,7 @@ setup_duplicate_socket(
 {\r
        char fname[100];\r
        HANDLE h = NULL;\r
-       int ret;\r
+       int ret, err;\r
        struct ibsp_duplicate_info *dup_info;\r
        ib_net64_t dest_port_guid;\r
        ib_path_rec_t path_rec;\r
@@ -176,6 +176,11 @@ setup_duplicate_socket(
                IBSP_ERROR( ("Failed to connect\n") );\r
                ret = WSAENETDOWN;\r
 err2:\r
+               g_ibsp.up_call_table.lpWPUCloseSocketHandle(\r
+                       socket_info->switch_socket, &err );\r
+               socket_info->switch_socket = INVALID_SOCKET;\r
+               STAT_DEC( wpusocket_num );\r
+\r
                ib_destroy_socket( socket_info );\r
        }\r
        else\r