|
@@ -562,6 +562,13 @@ int tcp_listen ( struct tcp_connection *conn, uint16_t local_port ) {
|
562
|
562
|
static uint16_t try_port = 1024;
|
563
|
563
|
int rc;
|
564
|
564
|
|
|
565
|
+#warning "Fix the port re-use bug"
|
|
566
|
+ /* If we re-use the same port, the connection should be reset
|
|
567
|
+ * and a new connection set up. This doesn't happen yet, so
|
|
568
|
+ * randomise the port to avoid hitting the problem.
|
|
569
|
+ */
|
|
570
|
+ try_port = random();
|
|
571
|
+
|
565
|
572
|
/* If no port specified, find the first available port */
|
566
|
573
|
if ( ! local_port ) {
|
567
|
574
|
for ( ; try_port ; try_port++ ) {
|