File 0266-esock-Comment-out-the-use-of-PACKET_FASTROUTE.patch of Package erlang
From f02710181c162ddcc110909ff63880fb5b7126cc Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Fri, 27 Mar 2020 10:29:32 +0100
Subject: [PATCH] [esock] Comment out the use of PACKET_FASTROUTE
On (at least some versions of) Android the use of this
constant results in compilation errors as it has the
same value as PACKET_USER.
On other linux variants (Linux Mint 19.3) there is a
comment in the include file that seems to indicate
that its un used and also non indented for user land.
But it still compils there, so there must be some undef
somehere (which is missing on Android).
OTP-16576
ERRL-1208
---
erts/emulator/nifs/common/socket_util.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/erts/emulator/nifs/common/socket_util.c b/erts/emulator/nifs/common/socket_util.c
index af44a86bb0..4741f2eb69 100644
--- a/erts/emulator/nifs/common/socket_util.c
+++ b/erts/emulator/nifs/common/socket_util.c
@@ -1600,6 +1600,7 @@ void esock_encode_packet_pkttype(ErlNifEnv* env,
break;
#endif
+ /* Unused? Not user space? */
#if defined(PACKET_LOOPBACK)
case PACKET_LOOPBACK:
*ePktType = esock_atom_loopback;
@@ -1618,11 +1619,17 @@ void esock_encode_packet_pkttype(ErlNifEnv* env,
break;
#endif
+ /* Unused? Not user space?
+ * Also, has the same value as PACKET_USER,
+ * so may result in a compiler error (at least
+ * on some platforms: ANDROID).
+ *
#if defined(PACKET_FASTROUTE)
case PACKET_FASTROUTE:
*ePktType = esock_atom_fastroute;
break;
#endif
+ */
default:
*ePktType = MKUI(env, pkttype);
--
2.16.4