8144672: (ch) PipeImpl should use localhost instead of loopback address
authorbpb
Wed, 14 Feb 2018 08:15:07 -0800
changeset 48896 1e358cc5af98
parent 48895 7a1916641c0c
child 48897 3f19b5965355
8144672: (ch) PipeImpl should use localhost instead of loopback address Reviewed-by: alanb, clanger
src/java.base/windows/classes/sun/nio/ch/PipeImpl.java
--- a/src/java.base/windows/classes/sun/nio/ch/PipeImpl.java	Wed Feb 14 15:27:29 2018 +0100
+++ b/src/java.base/windows/classes/sun/nio/ch/PipeImpl.java	Wed Feb 14 08:15:07 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@
                     ByteBuffer bb = ByteBuffer.allocate(NUM_SECRET_BYTES);
 
                     // Loopback address
-                    InetAddress lb = InetAddress.getByName("127.0.0.1");
+                    InetAddress lb = InetAddress.getLoopbackAddress();
                     assert(lb.isLoopbackAddress());
                     InetSocketAddress sa = null;
                     for(;;) {