From d8dbe6ea319b4974157c62ffa38baa6672f12f39 Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Wed, 26 Oct 2005 12:37:58 +0000 Subject: solves a bug, reported by Ken Russell from sun. (Problems with jdk1.6 and special network configs) The localhost address was null by calling InetAddress.getByName("localhost").getAddress() see java api doc: InetAddress.getByName(null) is the correct (but strange) method to get the localhost InetAddress. --- src/jake2/qcommon/netadr_t.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/jake2/qcommon/netadr_t.java b/src/jake2/qcommon/netadr_t.java index 40f27d5..e15f74f 100644 --- a/src/jake2/qcommon/netadr_t.java +++ b/src/jake2/qcommon/netadr_t.java @@ -19,7 +19,7 @@ */ // Created on 27.11.2003 by RST. -// $Id: netadr_t.java,v 1.5 2004-10-20 20:37:32 cawe Exp $ +// $Id: netadr_t.java,v 1.6 2005-10-26 12:37:58 cawe Exp $ package jake2.qcommon; import jake2.Defines; @@ -40,7 +40,8 @@ public class netadr_t { this.type = Defines.NA_LOOPBACK; this.port = 0; // any try { - this.ip = InetAddress.getByName("localhost").getAddress(); + // localhost / 127.0.0.1 + this.ip = InetAddress.getByName(null).getAddress(); } catch (UnknownHostException e) { } } @@ -50,7 +51,8 @@ public class netadr_t { case Defines.NA_BROADCAST: return InetAddress.getByName("255.255.255.255"); case Defines.NA_LOOPBACK: - return InetAddress.getByName("localhost"); + // localhost / 127.0.0.1 + return InetAddress.getByName(null); case Defines.NA_IP: return InetAddress.getByAddress(ip); default: -- cgit v1.2.3