This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in Cygwin - networking api ??


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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]