fix missing define on ipv4.c

This commit is contained in:
etmatrix 2021-11-01 17:02:28 +01:00 committed by Yaksh Bariya
parent b5033fb463
commit 47110757dd
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
2 changed files with 23 additions and 0 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="libnetfilter_queue is a userspace library providing an A
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.0.5
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=http://ftp.netfilter.org/pub/libnetfilter_queue/libnetfilter_queue-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=f9ff3c11305d6e03d81405957bdc11aea18e0d315c3e3f48da53a24ba251b9f5
TERMUX_PKG_DEPENDS="libnfnetlink, libmnl"

View File

@ -0,0 +1,22 @@
diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
index 797bab1..37eae7b 100644
--- a/src/extra/ipv4.c
+++ b/src/extra/ipv4.c
@@ -20,6 +20,17 @@
#include "internal.h"
+// on debian linux system netinet/ip.h has this define
+// on ndk-sysroot there are only in linux/ip.h but include it
+// introduce an issue on redifinition
+#define IPTOS_CLASS_MASK 0xe0
+#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK)
+
+#define IPTOS_PREC(tos) IPTOS_CLASS(tos)
+
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+
/**
* \defgroup ipv4 IPv4 helper functions
* @{