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]

raw sockets (Re: Bug in Cygwin - networking api ??)


OK, I tried the April 4 snapshot of cygwin1.dll now.

I compiled the traceroute code to call socket() like:

 socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)

this seems to work for sending as long as you call
sendto() with the icmp packet and data. I'm not sure
how standard this is, as the only other #ifdef in traceroute
that uses this is hpux. Perhaps cygwin sendto() should skip
the ip header to be more compatible? Is IP_HDRINCL supported in Cygwin?

If I call socket() with IPPROTO_UDP instead, UDP packets
are actually sent out, but with the destination port = 0.
This might just be a Windows thing, because the Winsock
faq says that RAW sockets only work for ICMP or IGMP. 

Anyway, that's the sending side. The recvfrom() that is
listening for the ICMP response never returns data. 



JPM


To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com> 
Subject: Re: Bug in Cygwin - networking api ?? 
From: Corinna Vinschen <cygwin at cygwin dot com> 
Date: Thu, 5 Apr 2001 09:53:26 +0200 
References: <99C92DEAB441D411883F00D0B747A9C60243C848@yvrxch01.gt.ca> 

----------------------------------------------------------------------------
----

On Wed, Apr 04, 2001 at 06:53:40PM -0700, John Paul Morrison wrote:
> 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,

Try a current developers snapshot, please. AFAICS, it should work
now.

Corinna


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