diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 062a0c6df..2c51ffd7b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Tue May 15 10:20:00 2001 Corinna Vinschen + + * fhandler_socket.cc (fhandler_socket::ioctl): Convert s_addr + field to host byte order before comparing with INADDR_LOOPBACK. + Tue May 15 9:03:00 2001 Corinna Vinschen * autoload.cc: Add autoload statements for ws2_32 functions diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index eb6f36a2e..288b4f4e5 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -15,6 +15,7 @@ #include "winsup.h" #include #include +#include #include #include @@ -291,7 +292,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) return -1; } ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING; - if (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr + if (ntohl (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr) == INADDR_LOOPBACK) ifr->ifr_flags |= IFF_LOOPBACK; else