diff options
| author | Michael Brown | 2006-08-09 16:44:58 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-08-09 16:44:58 +0200 |
| commit | dc8b96b4467f897faa2501c1a187231df8c969f9 (patch) | |
| tree | 868ca8053003ffac613ef52f4d96f7b5533d7a5c | |
| parent | Correct some packet ownership and freeing bugs. (diff) | |
| download | ipxe-dc8b96b4467f897faa2501c1a187231df8c969f9.tar.gz ipxe-dc8b96b4467f897faa2501c1a187231df8c969f9.tar.xz ipxe-dc8b96b4467f897faa2501c1a187231df8c969f9.zip | |
Temporarily work around the bug when port numbers are reused between
subsequent runs.
| -rw-r--r-- | src/net/tcp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c index 0ec119e66..0de629e84 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -562,6 +562,13 @@ int tcp_listen ( struct tcp_connection *conn, uint16_t local_port ) { static uint16_t try_port = 1024; int rc; +#warning "Fix the port re-use bug" + /* If we re-use the same port, the connection should be reset + * and a new connection set up. This doesn't happen yet, so + * randomise the port to avoid hitting the problem. + */ + try_port = random(); + /* If no port specified, find the first available port */ if ( ! local_port ) { for ( ; try_port ; try_port++ ) { |
