delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/04/11/12:34:15

Message-Id: <200204111634.g3BGYDQ29266@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Mark Paulus" <mpaulus78 AT earthlink DOT net>
To: "cygwin" <cygwin AT cygwin DOT com>
Date: Thu, 11 Apr 2002 10:33:53 -0600
Reply-To: "Mark Paulus" <mpaulus78 AT earthlink DOT net>
In-Reply-To: <20020411170740.B20801@cygbert.vinschen.de>
MIME-Version: 1.0
Subject: Re: Wierdness of WSASendTo()??

Ok, I have done some browsing, and now I'm totally 
confused.

According to Microsoft, there are 2 headers and libraries:
winsock.h
Ws2tcpip.h

Since I can seem to use the IP_HDRINCL macro, I am picking
ws2tcpip.h file.

However, I can't seem to figure out how to set the option.
When I invoke the following code fragment:

#ifdef IP_HDRINCL
  /*  FreeBSD wants this to avoid sending out packets with protocol type RAW
      to the network.  */
  if(setsockopt(sendsock, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt)))
  {
    perror("setsockopt(IP_HDRINCL,1)");
    return -1;
  }
#endif

I get the following from strace, which indicates that maybe cygwin doesn't
support IP_HDRINCL???  

  202  280647 [main] mtr 2576 cygwin_socket: socket (2, 3, 255)
 4034  284681 [main] mtr 2576 wsock_init: res 0
  210  284891 [main] mtr 2576 wsock_init: wVersion 514
  281  285172 [main] mtr 2576 wsock_init: wHighVersion 514
  177  285349 [main] mtr 2576 wsock_init: szDescription WinSock 2.0
  174  285523 [main] mtr 2576 wsock_init: szSystemStatus Running
  171  285694 [main] mtr 2576 wsock_init: iMaxSockets 0
  170  285864 [main] mtr 2576 wsock_init: iMaxUdpDg 0
  372  286236 [main] mtr 2576 wsock_init: lpVendorInfo 0
64252  350488 [main] mtr 2576 fdsock: not setting socket inheritance since winsock2_active 1
  272  350760 [main] mtr 2576 dtable::build_fhandler: fd 3, fh 0x615607C0
  169  350929 [main] mtr 2576 fdsock: fd 3, name '/dev/udp', soc 0x27C
  168  351097 [main] mtr 2576 cygwin_socket: 3 = socket (2, 3, 255)
 5043  356140 [main] mtr 2576 cygwin_setsockopt: setsockopt optval=1
  352  356492 [main] mtr 2576 cygwin_setsockopt: 0 = setsockopt (3, 0, 1 (SO_DEBUG), 22FE40, 4)


Do I need to maybe restructure my code so that I do not create a header???


On Thu, 11 Apr 2002 17:07:40 +0200, Corinna Vinschen wrote:

>On Thu, Apr 11, 2002 at 08:20:59AM -0600, Mark Paulus wrote:
>> MTR believes it's sending out a good ICMP packet of 64 bytes (0x40).
>> cygwin_sendto() also thinks it's sending out 64 bytes (as reported by strace).
>> 
>> However, tcpdump on my linux box is receiving 84 bytes.  
>> 
>> What it looks like to me is that somehow WSASendTo is re-formatting 
>> the packet that is going out.  But, this
>> turns it into an invalid packet, and causes a "network unreachable" error
>> on the linux box, and the response never comes back.
>> 
>> Has anyone seen this behaviour before??
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/wsanxref_8xo2.asp
>
>Look for IP_HDRINCL.
>
>
>Corinna
>
>-- 
>Corinna Vinschen                  Please, send mails regarding Cygwin to
>Cygwin Developer                                mailto:cygwin AT cygwin DOT com
>Red Hat, Inc.
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019