This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Patch: socket protocol parameter not handled correctly.
- To: <cygwin-patches at cygwin dot com>
- Subject: Patch: socket protocol parameter not handled correctly.
- From: "Mathew Brozowski" <brozow at tavve dot com>
- Date: Sat, 17 Mar 2001 10:15:50 -0500
- Reply-To: "Mathew Brozowski" <brozow at tavve dot com>
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)
{