delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/04/19:42:36

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: <99C92DEAB441D411883F00D0B747A9C60243C846@yvrxch01.gt.ca>
From: John Paul Morrison <jmorrison AT gt DOT ca>
To: "'ashishcn AT cisco DOT com'" <ashishcn AT cisco DOT com>
Cc: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Bug in Cygwin - networking api ??
Date: Wed, 4 Apr 2001 16:19:52 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

Did you ever get any replies to this? I was trying to compile traceroute in
the latest
Cygwin and couldn't get it working. 

I did a little bit of digging on the web, and a couple sites said that 
either winsock itself was broken for raw sockets, or you had to dig deeper
into the windows API (reverse engineer tracert.exe and icmp.dll?); 

another site added that in Windows NT only administrators could create raw
sockets (and gave a registry key to disable the behaviour). 



-----------------
Bug in Cygwin - networking api ??
To: cygwin AT sourceware DOT cygnus DOT com 
Subject: Bug in Cygwin - networking api ?? 
From: "Ashish C. Nagre" <ashishcn AT cisco DOT com> 
Date: Thu, 03 Jun 1999 10:56:46 -0700 
Organization: Cisco Systems 
Reply-To: ashishcn AT cisco DOT com 

Hello,
I  have come across two important problems with the cygnus socket
implemntation.

1. A raw socket is opened with the following call:
		
	s = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)
but when I used "snoop" to look at the packets being out on the wire,
the protocol field contained in the packets was 255 (RAW)
On changing the above socket call to 
	s = socket (AF_INET, SOCK_RAW, IPPROTO_UDP)
It put the correct value that was expected.

2. When packets are sent to it, they are not picked up (or not being
given to the application for some reason)
The socket calls used to wait for a packet are as follows: 

	fd_set fds;
	struct sockaddr_in *fromp;
	int fromlen = sizeof (*fromp);

	FD_ZERO (&fds);
	FD_SET (sock, &fds);
	
	if (select (sock + 1, &fds, NULL, NULL, &wait) > 0)
		cc = recvfrom (s, (char*)packet, sizeof(packet)), 0,
			(struct sockaddr *)fromp, &fromlen);

Is there some problem with the implementation of the select call ?
Does some special care have to be taken ?
The code that is being used has been around ('around' as in 'being
used') for a long time, and is an important application on all UNIX
systems. (To those who are curious, it is the traceroute by Van
Jacobson).
For now, the strange behaviour of this code seems to me like a bug(s) in
the implementation of the networking API in cygwin.

I will be very grateful to anyone answering these questions.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

--
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