Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331567

Summary: IPAccessHandlerTest.java fails consistently on MacOS
Product: [RT] Jetty Reporter: Thomas Becker <tbecker>
Component: serverAssignee: Greg Wilkins <gregw>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: jetty-inbox
Version: unspecifiedFlags: gregw: iplog+
Target Milestone: 7.1.x   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
fix none

Description Thomas Becker CLA 2010-12-01 11:56:53 EST
Build Identifier: 

On MacOS IPAccessHandler resolves localhost to the real network device if there's a network connection.

Even if the connection is setup like this:

Socket socket = new Socket("localhost", _connector.getLocalPort());

One would expect that localhost will be mapped to the loopback ip 127.0.0.1, but MacOS seems to map it to the real IP if a real network connection is established. Test is green when I disable all network connections.

However changing it to: 
Socket socket = new Socket("127.0.0.1", _connector.getLocalPort());

fixes the issue. 

Reproducible: Always

Steps to Reproduce:
1. Run IPAccessHandlerTest on MacOS with some wireless connection established.
Comment 1 Thomas Becker CLA 2010-12-01 12:01:51 EST
Created attachment 184276 [details]
fix

Changed "localhost" to "127.0.0.1". Works.
Comment 2 Greg Wilkins CLA 2010-12-01 12:30:57 EST
patch applied r2566
thanks
Comment 3 Thomas Becker CLA 2010-12-02 03:08:39 EST
thx Greg