From: John Hodge Date: Sun, 3 Jul 2011 03:18:26 +0000 (+0800) Subject: IPStack - Fixed invalid window size in outgoing TCP packets X-Git-Tag: rel0.10~51 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=fcd0edcb2a6fc81db61046cfa685ce32037b673f;p=tpg%2Facess2.git IPStack - Fixed invalid window size in outgoing TCP packets --- diff --git a/Modules/IPStack/tcp.c b/Modules/IPStack/tcp.c index 8ebf0aee..68e72d76 100644 --- a/Modules/IPStack/tcp.c +++ b/Modules/IPStack/tcp.c @@ -64,6 +64,7 @@ Uint32 gaTCP_PortBitmap[0x800]; */ void TCP_Initialise(void) { + giTCP_NextOutPort += rand()%32; IPStack_AddFile(&gTCP_ServerFile); IPStack_AddFile(&gTCP_ClientFile); IPv4_RegisterCallback(IP4PROT_TCP, TCP_GetPacket); @@ -1064,7 +1065,7 @@ void TCP_INT_SendDataPacket(tTCPConnection *Connection, size_t Length, void *Dat packet->SourcePort = htons(Connection->LocalPort); packet->DestPort = htons(Connection->RemotePort); packet->DataOffset = (sizeof(tTCPHeader)/4)*16; - packet->WindowSize = TCP_WINDOW_SIZE; + packet->WindowSize = htons(TCP_WINDOW_SIZE); packet->AcknowlegementNumber = htonl(Connection->NextSequenceRcv); packet->SequenceNumber = htonl(Connection->NextSequenceSend);