File 0001-Replace_IP_PROTOCOL_with_IPV4_ETHERTYPE_to_avoid_conflict_with_Linux_headers.patch of Package dolphin-primehack
From beebe0a2000826de66c911344c7efca4872262ff Mon Sep 17 00:00:00 2001
From: "Admiral H. Curtiss" <pikachu025@gmail.com>
Date: Wed, 4 Oct 2023 16:13:16 +0200
Subject: [PATCH] Core/BBA/BuiltIn: Replace IP_PROTOCOL with IPV4_ETHERTYPE to
avoid conflict with Linux headers.
---
Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp | 3 ++-
Source/Core/Core/HW/EXI/BBA/BuiltIn.h | 3 ---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp b/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp
index 6e5c3eac9749..4782a0a8b0a7 100644
--- a/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp
+++ b/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp
@@ -13,6 +13,7 @@
#include "Common/BitUtils.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
+#include "Common/Network.h"
#include "Common/ScopeGuard.h"
#include "Core/HW/EXI/EXI_Device.h"
#include "Core/HW/EXI/EXI_DeviceEthernet.h"
@@ -746,7 +747,7 @@ void CEXIETHERNET::BuiltInBBAInterface::ReadThreadHandler(CEXIETHERNET::BuiltInB
u8* buffer = reinterpret_cast<u8*>(self->m_eth_ref->mRecvBuffer.get());
Common::PacketView packet(buffer, datasize);
const auto packet_type = packet.GetEtherType();
- if (packet_type.has_value() && packet_type == IP_PROTOCOL)
+ if (packet_type.has_value() && packet_type == Common::IPV4_ETHERTYPE)
{
SetIPIdentification(buffer, datasize, ++self->m_ip_frame_id);
}
diff --git a/Source/Core/Core/HW/EXI/BBA/BuiltIn.h b/Source/Core/Core/HW/EXI/BBA/BuiltIn.h
index 4478f4de48da..afcf39d2931b 100644
--- a/Source/Core/Core/HW/EXI/BBA/BuiltIn.h
+++ b/Source/Core/Core/HW/EXI/BBA/BuiltIn.h
@@ -20,9 +20,6 @@ constexpr u16 TCP_FLAG_PSH = 0x8;
constexpr u16 TCP_FLAG_FIN = 0x1;
constexpr u16 TCP_FLAG_RST = 0x4;
-constexpr u16 IP_PROTOCOL = 0x800;
-constexpr u16 ARP_PROTOCOL = 0x806;
-
constexpr u8 MAX_TCP_BUFFER = 4;
constexpr u16 MAX_UDP_LENGTH = 1500;
constexpr u16 MAX_TCP_LENGTH = 440;