Parcourir la source

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

tags/v0.9.3
Michael Brown il y a 18 ans
Parent
révision
b9f9230661
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8
    0
      src/net/tcp.c

+ 8
- 0
src/net/tcp.c Voir le fichier

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

Chargement…
Annuler
Enregistrer