On Sun, Feb 11, 2001 at 10:36:15AM -0800, Andrew Chang wrote:

> I was trying install cygwin rshd recently, It seems to work.
> except for one strange behavior: under the rshd
> environment, the winsock2 gethostbyname() interface will return
> WSAHOST_NOT_FOUND. It works fine if I  run the same code
> under rlogind or locally. (The application I am running is
> a very simple (20 lines of C code, no GUI) winsock application,
> it is not linked to the cygwin dll.


This may help explain the behaviour if you are linking to ws2_32.dll.

There are problems with the use of the WinSock2 API (ws2_32.dll) in
combination with the IPPROTO_IP level options defined in either
win32api/winsock.h or in cygwin/socket.h. 


The IPPROTO_IP level macros defined in winsock.h or socket.h for
Winsock
1.1 are consistent with the original values Steve Deering defined in
his
document "IP Multicast Extensions for 4.3BSD UNIX related systems
(MULTICAST 1.2 Release)." However, these conflicted with the
definitions
for some IPPROTO_IP level socket options already assigned by BSD, so
Berkeley changed all the values by adding 7. 

ws2_32.dll uses the 4.4BSD compatible values defined below. 

#define IP_TOS  3   /* old (winsock 1.1) value 8 */
#define IP_TTL  4  /* old value 7 */
#define IP_MULTICAST_IF         9 /* old value 2 */
#define IP_MULTICAST_TTL    10 /* old value 3 */
#define IP_MULTICAST_LOOP   11 /* old value 4 */
#define IP_ADD_MEMBERSHIP   12 /* old value 5 */
#define IP_DROP_MEMBERSHIP  13 /* old value 6 */
#define IP_DONTFRAGMENT 14 /* old value 9 */


This change can cause errors or unexpected behaviour with the
[gs]etsockopt when mixing winsock1.1 definitions with the winsock2
library functions. (Recent versions of winsock32.dll forward most
exports to either ws2_32.dll or mswsock.dll, but - to retain backward
compatability - uses own versions of [gs]sockopt).

See also: msdn kb article Q257460
http://support.microsoft.com/support/kb/articles/Q257/4/60.asp

I will submit a patch for win32api/winsock2.h to the mingw project.

Danny



_____________________________________________________________________________
http://entertainment.yahoo.com.au - Yahoo! Entertainment
- Feeling a little bored? Need some entertainment?

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

Reply via email to