This is the mail archive of the cygwin@cygwin.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]

RE: Bug in Cygwin - networking api ??


Yes. Since we were talking about the same code (The Van Jacobson traceroute
source code), I thought I'd see if any progress has been made. 

It looks like the socket() call doesn't work as expected for SOCK_RAW.
A tcpdump shows that the packet is sent out with IP protocol 0,
and that the "real" IP datagram follows in the payload of the packet
sent out. 

 ./traceroute.exe -I  -n  170.170.170.170

tcpdump output:

17:58:46.758691 204.239.147.14 > 170.170.170.170: ip-proto-0 40 (ttl 2, id
50679)
ip header (20 bytes)
                         4500 003c c5f7 0000 0200 3d78 ccef 930e
                         aaaa aaaa 

Beginning of "real" IP packet, which correct protocol type etc.

                                   4500 0028 8234 0000 0201 fefc
                         0000 0000 aaaa aaaa 0800 e4e4 822e 0006
                         0602 0000 46c3 cb3a 78e6 0000 9ed7 0bfd
                         33ea 8626 715b 478c 69b5 c461 4160 2944
                         d5d3 6c50 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000


And regarding the original message I responded to, it doesn't 
look like select() is the problem, but instead it's the recvfrom()
that never returns any data.


> -----Original Message-----
> From: Christopher Faylor [mailto:cgf@redhat.com]
> Sent: Wednesday, April 04, 2001 4:48 PM
> To: 'cygwin@cygwin.com'
> Cc: jmorrison@gt.ca
> Subject: Re: Bug in Cygwin - networking api ??
> 
> 
> You realize that the email that you quoted comes from almost 
> two years ago,
> right?
> 
> cgf
> 
> On Wed, Apr 04, 2001 at 04:19:52PM -0700, John Paul Morrison wrote:
> >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@sourceware.cygnus.com 
> >Subject: Bug in Cygwin - networking api ?? 
> >From: "Ashish C. Nagre" <ashishcn@cisco.com> 
> >Date: Thu, 03 Jun 1999 10:56:46 -0700 
> >Organization: Cisco Systems 
> >Reply-To: ashishcn@cisco.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@sourceware.cygnus.com
> >
> >--
> >Want to unsubscribe from this list?
> >Check out: http://cygwin.com/ml/#unsubscribe-simple
> 
> -- 
> cgf@cygnus.com                        Red Hat, Inc.
> http://sources.redhat.com/            http://www.redhat.com/
> 

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


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