IPStack - Heaps of network fixes
[tpg/acess2.git] / Modules / IPStack / tcp.c
index 3741503..18150a3 100644 (file)
@@ -84,7 +84,7 @@ void TCP_SendPacket( tTCPConnection *Conn, size_t Length, tTCPHeader *Data )
                buf[2] = (htons(Length)<<16) | (6<<8) | 0;
                Data->Checksum = 0;
                memcpy( &buf[3], Data, Length );
-               Data->Checksum = IPv4_Checksum( buf, buflen );
+               Data->Checksum = htons( IPv4_Checksum( buf, buflen ) );
                free(buf);
                IPv4_SendPacket(Conn->Interface, Conn->RemoteIP.v4, IP4PROT_TCP, 0, Length, Data);
                break;
@@ -231,7 +231,7 @@ void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffe
                        srv->ConnectionsTail = conn;
                        if(!srv->NewConnections)
                                srv->NewConnections = conn;
-                       SHORTLOCK(&srv->lConnections);
+                       SHORTREL(&srv->lConnections);
 
                        // Send the SYN ACK
                        hdr->Flags |= TCP_FLAG_ACK;

UCC git Repository :: git.ucc.asn.au