diff options
author | Carsten Weisse <[email protected]> | 2005-10-26 12:37:58 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2005-10-26 12:37:58 +0000 |
commit | d8dbe6ea319b4974157c62ffa38baa6672f12f39 (patch) | |
tree | faec34608b512f5e5b58bab4ef44ea67ecde6708 /src | |
parent | fb5e549bb3f87cb48207e5927f847288c99de019 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/jake2/qcommon/netadr_t.java | 8 |
1 files changed, 5 insertions, 3 deletions
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: |