arty:
Always keep port numbers in network byte order
Modified: trunk/reactos/drivers/lib/ip/network/ports.c
Modified: trunk/reactos/drivers/net/tcpip/tcpip/dispatch.c
_____
Modified: trunk/reactos/drivers/lib/ip/network/ports.c
--- trunk/reactos/drivers/lib/ip/network/ports.c 2005-03-13
21:37:54 UTC (rev 14035)
+++ trunk/reactos/drivers/lib/ip/network/ports.c 2005-03-13
21:41:44 UTC (rev 14036)
@@ -30,6 +30,7 @@
}
VOID DeallocatePort( PPORT_SET PortSet, ULONG Port ) {
+ Port = htons(Port);
RtlClearBits( &PortSet->ProtoBitmap,
PortSet->StartingPort + Port, 1 );
}
@@ -37,6 +38,7 @@
BOOLEAN AllocatePort( PPORT_SET PortSet, ULONG Port ) {
BOOLEAN Clear;
+ Port = htons(Port);
Port -= PortSet->StartingPort;
ExAcquireFastMutex( &PortSet->Mutex );
@@ -58,6 +60,8 @@
}
ExReleaseFastMutex( &PortSet->Mutex );
+ AllocatedPort = htons(AllocatedPort);
+
return AllocatedPort;
}
@@ -76,5 +80,7 @@
}
ExReleaseFastMutex( &PortSet->Mutex );
+ AllocatedPort = htons(AllocatedPort);
+
return AllocatedPort;
}
_____
Modified: trunk/reactos/drivers/net/tcpip/tcpip/dispatch.c
--- trunk/reactos/drivers/net/tcpip/tcpip/dispatch.c 2005-03-13
21:37:54 UTC (rev 14035)
+++ trunk/reactos/drivers/net/tcpip/tcpip/dispatch.c 2005-03-13
21:41:44 UTC (rev 14036)
@@ -621,7 +621,7 @@
Address->TAAddressCount = 1;
Address->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
Address->Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
- Address->Address[0].Address[0].sin_port =
htons(AddrFile->Port);
+ Address->Address[0].Address[0].sin_port = AddrFile->Port;
Address->Address[0].Address[0].in_addr =
AddrFile->Address.Address.IPv4Address;
RtlZeroMemory(
Show replies by date