瀏覽代碼

Work around another instance of the port re-use bug.

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
b9f9230661
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. 8
    0
      src/net/tcp.c

+ 8
- 0
src/net/tcp.c 查看文件

@@ -466,6 +466,14 @@ int tcp_connectto ( struct tcp_connection *conn,
466 466
 		return -EISCONN;
467 467
 	}
468 468
 
469
+#warning "Fix the port re-use bug"
470
+	/* If we re-use the same port, the connection should be reset
471
+	 * and a new connection set up.  This doesn't happen yet, so
472
+	 * force the use of a new (random) port to avoid hitting the
473
+	 * problem.
474
+	 */
475
+	conn->local_port = 0;
476
+
469 477
 	/* Add the connection to the set of listening connections */
470 478
 	if ( ( rc = tcp_listen ( conn, conn->local_port ) ) != 0 ) {
471 479
 		return rc;

Loading…
取消
儲存