* fhandler_socket.cc (fhandler_socket::ioctl): Convert s_addr
field to host byte order before comparing with INADDR_LOOPBACK.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | Tue May 15 10:20:00 2001  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* 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 <corinna@vinschen.de> | Tue May 15  9:03:00 2001  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* autoload.cc: Add autoload statements for ws2_32 functions | 	* autoload.cc: Add autoload statements for ws2_32 functions | ||||||
|   | |||||||
| @@ -15,6 +15,7 @@ | |||||||
| #include "winsup.h" | #include "winsup.h" | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #include <sys/socket.h> | #include <sys/socket.h> | ||||||
|  | #include <asm/byteorder.h> | ||||||
|  |  | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| @@ -291,7 +292,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) | |||||||
| 	  return -1; | 	  return -1; | ||||||
| 	} | 	} | ||||||
|       ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING; |       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) |           == INADDR_LOOPBACK) | ||||||
|         ifr->ifr_flags |= IFF_LOOPBACK; |         ifr->ifr_flags |= IFF_LOOPBACK; | ||||||
|       else |       else | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user