Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <99C92DEAB441D411883F00D0B747A9C60243C84E@yvrxch01.gt.ca> From: John Paul Morrison To: "'cygwin AT cygwin DOT com'" Subject: raw sockets (Re: Bug in Cygwin - networking api ??) Date: Fri, 6 Apr 2001 00:49:28 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain 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'" Subject: Re: Bug in Cygwin - networking api ?? From: Corinna Vinschen Date: Thu, 5 Apr 2001 09:53:26 +0200 References: <99C92DEAB441D411883F00D0B747A9C60243C848 AT yvrxch01 DOT gt DOT 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