RFR 8144672: (ch) PipeImpl should use localhost instead of loopback address

Langer, Christoph christoph.langer at sap.com
Wed Feb 14 08:24:58 UTC 2018


+1

Best regards
Christoph

> -----Original Message-----
> From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of
> Alan Bateman
> Sent: Mittwoch, 14. Februar 2018 08:43
> To: Brian Burkhalter <brian.burkhalter at oracle.com>; nio-dev <nio-
> dev at openjdk.java.net>
> Subject: Re: RFR 8144672: (ch) PipeImpl should use localhost instead of
> loopback address
> 
> On 14/02/2018 00:09, Brian Burkhalter wrote:
> > https://bugs.openjdk.java.net/browse/JDK-8144672
> >
> > Replace the hard-coded IPv4 loopback address:
> >
> > --- a/src/java.base/windows/classes/sun/nio/ch/PipeImpl.java
> > +++ b/src/java.base/windows/classes/sun/nio/ch/PipeImpl.java
> > @@ -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());
> >
> >
> This looks okay to me.
> 
> (I don't get Martin's comment about using getHostAddress, maybe useful
> for tests but you need an InetAddress here, not a String).
> 
> -Alan


More information about the nio-dev mailing list