Commit in reactos/drivers on MAIN
net/tcpip/makefile+2-21.30 -> 1.31
net/tcpip/datalink/lan.c+11-91.23 -> 1.24
net/tcpip/tcpip/dispatch.c+21.21 -> 1.22
               /main.c+2-21.39 -> 1.40
lib/ip/network/router.c+1-11.3 -> 1.4
lib/ip/transport/tcp/event.c+6-31.5 -> 1.6
                    /tcp.c-21.7 -> 1.8
+24-19
7 modified files
lib/ip:
 transport/tcp/* remove some spew, eliminate deadlock condition (calling afd 
  with socket locked).
 network/router.c -- GvG noticed a wrong condition at line 153:
  This code used to stop when finding a matching bit, not a non-matching one.
net/tcpip:
 makefile: change order of .a files.  Could break compilation before under
  the right circumstances.
 turn off some spew
 datalink/lan.c:
  NdisTransferData does not count header size when figuring out how many bytes
  to copy.  Most of the tcpip code does, so we do something wierd here.  We
  must fix this later in a better way.

reactos/drivers/net/tcpip
makefile 1.30 -> 1.31
diff -u -r1.30 -r1.31
--- makefile	7 Nov 2004 20:37:18 -0000	1.30
+++ makefile	13 Nov 2004 00:06:32 -0000	1.31
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.30 2004/11/07 20:37:18 arty Exp $
+# $Id: makefile,v 1.31 2004/11/13 00:06:32 arty Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -22,8 +22,8 @@
 	-I$(PATH_TO_TOP)/include
 
 TARGET_DDKLIBS = \
-	$(PATH_TO_TOP)/dk/w32/lib/oskittcp.a \
 	$(PATH_TO_TOP)/dk/w32/lib/ip.a \
+	$(PATH_TO_TOP)/dk/w32/lib/oskittcp.a \
 	$(PATH_TO_TOP)/dk/w32/lib/rosrtl.a \
 	ndis.a
 

reactos/drivers/net/tcpip/datalink
lan.c 1.23 -> 1.24
diff -u -r1.23 -r1.24
--- lan.c	9 Nov 2004 09:39:36 -0000	1.23
+++ lan.c	13 Nov 2004 00:06:32 -0000	1.24
@@ -225,6 +225,8 @@
 		     IPPacket.ContigSize, IPPacket.TotalSize,
 		     BytesTransferred));
 
+	/*OskitDumpBuffer( IPPacket.Header, IPPacket.TotalSize );*/
+
         PacketType = ((PETH_HEADER)IPPacket.Header)->EType;
 	IPPacket.Header = ((PCHAR)IPPacket.Header) + sizeof(ETH_HEADER);
 	IPPacket.Position = sizeof(ETH_HEADER);
@@ -373,17 +375,17 @@
     if ((LookaheadBufferSize + HeaderBufferSize) < PacketSize)
     {
         TI_DbgPrint(DEBUG_DATALINK, ("pretransfer LookaheadBufferSize %d packsize %d bufferdata %x\n",LookaheadBufferSize,PacketSize, BufferData));
-        /* Get the data */
-
-	*BufferData = 0;
-
-	TI_DbgPrint(DEBUG_DATALINK, ("Poked the buffer\n"));
-
+	/* The following is this way because we want a nice, whole packet
+	 * in NdisPacket, including ethernet header (which this code assumes)
+	 * is in there.  We are indeed retransferring some bytes.  Eventually,
+	 * I will change the downstream functions to take the payload only. 
+	 * 
+	 * Below: Count the ethernet header size, but don't count the crc */
         NdisTransferData(&NdisStatus,
                          Adapter->NdisHandle,
                          MacReceiveContext,
-                         0,
-                         PacketSize,
+			 0,
+                         PacketSize + sizeof(ETH_HEADER) - sizeof(ULONG),
                          NdisPacket,
                          &BytesTransferred);
     } else {
@@ -574,7 +576,7 @@
 		   ((PCHAR)LinkAddress)[5] & 0xff));
 	}
 
-	OskitDumpBuffer( Data, Size );
+	/*OskitDumpBuffer( Data, Size );*/
 
 	TcpipAcquireSpinLock( &Adapter->Lock, &OldIrql );
 	TI_DbgPrint(MID_TRACE, ("NdisSend\n"));

reactos/drivers/net/tcpip/tcpip
dispatch.c 1.21 -> 1.22
diff -u -r1.21 -r1.22
--- dispatch.c	9 Nov 2004 09:39:37 -0000	1.21
+++ dispatch.c	13 Nov 2004 00:06:32 -0000	1.22
@@ -202,6 +202,8 @@
     TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp));
 
     IRPFinish(Irp, Irp->IoStatus.Status);
+
+    TI_DbgPrint(DEBUG_IRP, ("Done Completing IRP\n"));
 }
 
 

reactos/drivers/net/tcpip/tcpip
main.c 1.39 -> 1.40
diff -u -r1.39 -r1.40
--- main.c	9 Nov 2004 09:39:37 -0000	1.39
+++ main.c	13 Nov 2004 00:06:32 -0000	1.40
@@ -9,12 +9,12 @@
  */
 #include "precomp.h"
 
-//#define NDEBUG
+#define NDEBUG
 
 #ifndef NDEBUG
 DWORD DebugTraceLevel = 0x7fffffff;
 #else
-DWORD DebugTraceLevel = 0;
+DWORD DebugTraceLevel = 0; /*DEBUG_IP | DEBUG_PBUFFER | DEBUG_DATALINK;*/
 #endif /* NDEBUG */
 
 PDEVICE_OBJECT TCPDeviceObject   = NULL;

reactos/drivers/lib/ip/network
router.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- router.c	9 Nov 2004 09:39:37 -0000	1.3
+++ router.c	13 Nov 2004 00:06:32 -0000	1.4
@@ -150,7 +150,7 @@
 
     /* Find first non-matching bit */
     Bitmask = 0x80;
-    for (j = 0; (Addr1[i] & Bitmask) != (Addr2[i] & Bitmask); j++)
+    for (j = 0; (Addr1[i] & Bitmask) == (Addr2[i] & Bitmask); j++)
         Bitmask >>= 1;
 
     return 8 * i + j;

reactos/drivers/lib/ip/transport/tcp
event.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- event.c	9 Nov 2004 09:39:37 -0000	1.5
+++ event.c	13 Nov 2004 00:06:33 -0000	1.6
@@ -43,7 +43,9 @@
 	    Complete = Bucket->Request.RequestNotifyObject;
 	    TI_DbgPrint(MID_TRACE,
 			("Completing Connect Request %x\n", Bucket->Request));
+	    TcpipRecursiveMutexLeave( &TCPLock );
 	    Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, 0 );
+	    TcpipRecursiveMutexEnter( &TCPLock, TRUE );
 	    /* Frees the bucket allocated in TCPConnect */
 	    PoolFreeBuffer( Bucket );
 	}
@@ -107,8 +109,10 @@
 			    ("Completing Receive Request: %x\n", 
 			     Bucket->Request));
 
+		TcpipRecursiveMutexLeave( &TCPLock );
 		Complete( Bucket->Request.RequestContext,
 			  STATUS_SUCCESS, Received );
+		TcpipRecursiveMutexEnter( &TCPLock, TRUE );
 	    } else if( Status == STATUS_PENDING || 
 		       (Status == STATUS_SUCCESS && Received == 0) ) {
 		InsertHeadList( &Connection->ReceiveRequest,
@@ -118,7 +122,9 @@
 		TI_DbgPrint(MID_TRACE,
 			    ("Completing Receive request: %x %x\n",
 			     Bucket->Request, Status));
+		TcpipRecursiveMutexLeave( &TCPLock );
 		Complete( Bucket->Request.RequestContext, Status, 0 );
+		TcpipRecursiveMutexEnter( &TCPLock, TRUE );
 	    }
 	}
     } 
@@ -146,9 +152,6 @@
     IP_ADDRESS RemoteAddress, LocalAddress;
     PIPv4_HEADER Header;
 
-    TI_DbgPrint(MID_TRACE,("TCP OUTPUT (%x:%d):\n", data, len));
-    OskitDumpBuffer( data, len );
-
     if( *data == 0x45 ) { /* IPv4 */
 	Header = (PIPv4_HEADER)data;
 	LocalAddress.Type = IP_ADDRESS_V4;

reactos/drivers/lib/ip/transport/tcp
tcp.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- tcp.c	9 Nov 2004 09:39:38 -0000	1.7
+++ tcp.c	13 Nov 2004 00:06:33 -0000	1.8
@@ -409,8 +409,6 @@
     TI_DbgPrint(MID_TRACE,("Connection->SocketContext = %x\n",
 			   Connection->SocketContext));
 
-    OskitDumpBuffer( BufferData, PacketSize );
-
     Status = OskitTCPSend( Connection->SocketContext, 
 			   BufferData, PacketSize, (PUINT)DataUsed, 0 );
 
CVSspam 0.2.8