Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-05-15 12:42:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-05-15 12:42:15 +0400
commitde81c0465d3d6ad8c1f86281d24260968db74fb7 (patch)
tree85b84b0f7596fc6c353df0ed40b4d1c9f8f6d1bb /winsup/cygwin/fhandler_socket.cc
parenta2cdb048f6d311c6d5b59efa76343006553f8438 (diff)
* fhandler_socket.cc (fhandler_socket::ioctl): Convert s_addr
field to host byte order before comparing with INADDR_LOOPBACK.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc3
1 files changed, 2 insertions, 1 deletions
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 <errno.h>
#include <sys/socket.h>
+#include <asm/byteorder.h>
#include <stdlib.h>
#include <unistd.h>
@@ -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