delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/11/17:45:14

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20010211224133.27131.qmail@web6404.mail.yahoo.com>
Date: Mon, 12 Feb 2001 11:41:33 +1300 (NZDT)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001 AT yahoo DOT co DOT nz>
Subject: Re: inetutils-1.3.2-10 on Cygwin 1.1.8-2
To: Cygwin <cygwin AT sources DOT redhat DOT com>
MIME-Version: 1.0

 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019