http://git.etherboot.org
/
people
/
xl0
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ac7694
)
Avoid reusing auto-allocated ports after connection close.
author
Michael Brown
<mcb30@etherboot.org>
Fri, 13 Jul 2007 10:25:00 +0000
(11:25 +0100)
committer
Michael Brown
<mcb30@etherboot.org>
Fri, 13 Jul 2007 10:25:00 +0000
(11:25 +0100)
src/net/tcp.c
patch
|
blob
|
history
diff --git
a/src/net/tcp.c
b/src/net/tcp.c
index
a2908f5
..
97d9dea
100644
(file)
--- a/
src/net/tcp.c
+++ b/
src/net/tcp.c
@@
-160,11
+160,12
@@
tcp_dump_flags ( struct tcp_connection *tcp, unsigned int flags ) {
*/
static int tcp_bind ( struct tcp_connection *tcp, unsigned int port ) {
struct tcp_connection *existing;
- static uint16_t try_port = 102
4
;
+ static uint16_t try_port = 102
3
;
/* If no port specified, find the first available port */
if ( ! port ) {
- for ( ; try_port ; try_port++ ) {
+ while ( try_port ) {
+ try_port++;
if ( try_port < 1024 )
continue;
if ( tcp_bind ( tcp, htons ( try_port ) ) == 0 )