From a06c3bf33666f8d2749381c5ef7f800c23f05c38 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 5 Oct 2011 06:18:16 +0000 Subject: [PATCH] * net.cc (socketpair): Bind first socket to loopback only as well. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/net.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 96aaaeefe..99a372c11 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2011-10-04 Corinna Vinschen + + * net.cc (socketpair): Bind first socket to loopback only as well. + 2011-09-21 Christopher Faylor * tty.cc (grantpt): Check for valid fd. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index e55dd03ed..7f4168036 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -2630,7 +2630,7 @@ socketpair (int family, int type, int protocol, int *sb) /* bind the socket to any unused port */ sock_in.sin_family = AF_INET; sock_in.sin_port = 0; - sock_in.sin_addr.s_addr = INADDR_ANY; + sock_in.sin_addr.s_addr = htonl (INADDR_LOOPBACK); if (bind (newsock, (struct sockaddr *) &sock_in, sizeof (sock_in)) < 0) { debug_printf ("bind failed");