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

Patch: socket protocol parameter not handled correctly.


I have been recently working on a port or a ping program to cygwin.  After I
got past the header problems (which I hope to send a separate patch for
soon) and got everything building it still wasn't working.  I used tcpdump
on a linux machine and found that the packets being sent were not encoded
with the ICMP protocol identifier but with the identifier 0.  I tracked it
down to the fact that the cygwin_socket routine wasn't passing the protocol
parameter to the Windows socket call.  After fixing this rebuilding the
cygwin1.dll the ping program worked great!  Here's the patch minor though it
is.

Matt Brozowski

Sat Mar 17 09:51:32 2001 Mathew Brozowski <brozow@tavve.com>

 * net.cc (cygwin_socket): Pass protocol parameter to socket call.

--- net.cc-orig Sat Mar 17 09:46:08 2001
+++ net.cc Sat Mar 17 09:49:10 2001
@@ -352,7 +352,7 @@ cygwin_socket (int af, int type, int pro
     {
       debug_printf ("socket (%d, %d, %d)", af, type, protocol);

-      soc = socket (AF_INET, type, 0);
+      soc = socket (AF_INET, type, protocol);

       if (soc == INVALID_SOCKET)
  {



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