Ver código fonte

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

tags/v0.9.3
Michael Brown 18 anos atrás
pai
commit
b9f9230661
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8
    0
      src/net/tcp.c

+ 8
- 0
src/net/tcp.c Ver arquivo

@@ -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;

Carregando…
Cancelar
Salvar