Making sure the 1st 2-bits on the 1st byte of MAC address' OUI are zero to prevent issue with some games (ie. Gran Turismo)

This commit is contained in:
ANR2ME committed 2020-09-03 05:17:42 +07:00
1 parent 9c5f02fbf5
commit ca059bc962
3 files changed
+9

No files matched your search

+4
View File
@@ -378,6 +378,10 @@ std::string CreateRandMAC() {
srand(time(nullptr));
for (int i = 0; i < 6; i++) {
u32 value = rand() % 256;
if (i == 0) {
// Making sure the 1st 2-bits on the 1st byte of OUI are zero to prevent issue with some games (ie. Gran Turismo)
value &= 0xfc;
}
if (value <= 15)
randStream << '0' << std::hex << value;
else
+3
View File
@@ -1668,10 +1668,13 @@ void getLocalMac(SceNetEtherAddr * addr){
uint8_t mac[ETHER_ADDR_LEN] = {0};
if (PPSSPP_ID > 1) {
memset(&mac, PPSSPP_ID, sizeof(mac));
// Making sure the 1st 2-bits on the 1st byte of OUI are zero to prevent issue with some games (ie. Gran Turismo)
mac[0] &= 0xfc;
}
else
if (!ParseMacAddress(g_Config.sMACAddress.c_str(), mac)) {
ERROR_LOG(SCENET, "Error parsing mac address %s", g_Config.sMACAddress.c_str());
memset(&mac, 0, sizeof(mac));
}
memcpy(addr, mac, ETHER_ADDR_LEN);
}
+2
View File
@@ -609,6 +609,8 @@ static u32 sceWlanGetEtherAddr(u32 addrAddr) {
u8 *addr = Memory::GetPointer(addrAddr);
if (PPSSPP_ID > 1) {
Memory::Memset(addrAddr, PPSSPP_ID, 6);
// Making sure the 1st 2-bits on the 1st byte of OUI are zero to prevent issue with some games (ie. Gran Turismo)
addr[0] &= 0xfc;
}
else
// Read MAC Address from config