|  | @@ -160,11 +160,12 @@ tcp_dump_flags ( struct tcp_connection *tcp, unsigned int flags ) {
 | 
		
	
		
			
			| 160 | 160 |   */
 | 
		
	
		
			
			| 161 | 161 |  static int tcp_bind ( struct tcp_connection *tcp, unsigned int port ) {
 | 
		
	
		
			
			| 162 | 162 |  	struct tcp_connection *existing;
 | 
		
	
		
			
			| 163 |  | -	static uint16_t try_port = 1024;
 | 
		
	
		
			
			|  | 163 | +	static uint16_t try_port = 1023;
 | 
		
	
		
			
			| 164 | 164 |  
 | 
		
	
		
			
			| 165 | 165 |  	/* If no port specified, find the first available port */
 | 
		
	
		
			
			| 166 | 166 |  	if ( ! port ) {
 | 
		
	
		
			
			| 167 |  | -		for ( ; try_port ; try_port++ ) {
 | 
		
	
		
			
			|  | 167 | +		while ( try_port ) {
 | 
		
	
		
			
			|  | 168 | +			try_port++;
 | 
		
	
		
			
			| 168 | 169 |  			if ( try_port < 1024 )
 | 
		
	
		
			
			| 169 | 170 |  				continue;
 | 
		
	
		
			
			| 170 | 171 |  			if ( tcp_bind ( tcp, htons ( try_port ) ) == 0 )
 |