DEV9: Fix typo in DHCP_Packet

This commit is contained in:
TheLastRar 2021-09-09 23:49:35 +01:00 committed by refractionpcsx2
parent f4b2e0dd7a
commit fef2952d47
3 changed files with 5 additions and 5 deletions

View File

@ -494,7 +494,7 @@ namespace InternalServers
retPay->options.push_back(new DHCPopSERVIP(NetAdapter::internalIP)); retPay->options.push_back(new DHCPopSERVIP(NetAdapter::internalIP));
retPay->options.push_back(new DHCPopEND()); retPay->options.push_back(new DHCPopEND());
retPay->maxLenth = maxMs; retPay->maxLength = maxMs;
UDP_Packet* retUdp = new UDP_Packet(retPay); UDP_Packet* retUdp = new UDP_Packet(retPay);
retUdp->sourcePort = 67; retUdp->sourcePort = 67;
retUdp->destinationPort = 68; retUdp->destinationPort = 68;

View File

@ -154,7 +154,7 @@ namespace PacketReader::IP::UDP::DHCP
int DHCP_Packet::GetLength() int DHCP_Packet::GetLength()
{ {
return maxLenth - (8 + 20); return maxLength - (8 + 20);
} }
void DHCP_Packet::WriteBytes(u8* buffer, int* offset) void DHCP_Packet::WriteBytes(u8* buffer, int* offset)
@ -185,7 +185,7 @@ namespace PacketReader::IP::UDP::DHCP
int len = 240; int len = 240;
for (size_t i = 0; i < options.size(); i++) for (size_t i = 0; i < options.size(); i++)
{ {
if (len + options[i]->GetLength() < maxLenth) if (len + options[i]->GetLength() < maxLength)
{ {
len += options[i]->GetLength(); len += options[i]->GetLength();
options[i]->WriteBytes(buffer, offset); options[i]->WriteBytes(buffer, offset);
@ -194,7 +194,7 @@ namespace PacketReader::IP::UDP::DHCP
{ {
Console.Error("DEV9: DHCP_Packet: Oversized DHCP packet not handled"); Console.Error("DEV9: DHCP_Packet: Oversized DHCP packet not handled");
//We need space for DHCP End //We need space for DHCP End
if (len == maxLenth) if (len == maxLength)
{ {
i -= 1; i -= 1;
int pastLength = options[i]->GetLength(); int pastLength = options[i]->GetLength();

View File

@ -42,7 +42,7 @@ namespace PacketReader::IP::UDP::DHCP
std::vector<BaseOption*> options; std::vector<BaseOption*> options;
//used by GetLength & WriteBytes //used by GetLength & WriteBytes
int maxLenth = 576; int maxLength = 576;
DHCP_Packet() {} DHCP_Packet() {}
DHCP_Packet(u8* buffer, int bufferSize); DHCP_Packet(u8* buffer, int bufferSize);