diff options
Diffstat (limited to 'net-p2p/freenet/files/0.7.5_p1491-update-for-jna-5.x.patch')
-rw-r--r-- | net-p2p/freenet/files/0.7.5_p1491-update-for-jna-5.x.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/net-p2p/freenet/files/0.7.5_p1491-update-for-jna-5.x.patch b/net-p2p/freenet/files/0.7.5_p1491-update-for-jna-5.x.patch new file mode 100644 index 000000000000..788a48040b17 --- /dev/null +++ b/net-p2p/freenet/files/0.7.5_p1491-update-for-jna-5.x.patch @@ -0,0 +1,31 @@ +From 830b4bb3948bd69fbd9b10001940f1775051114a Mon Sep 17 00:00:00 2001 +From: Yuan Liao <liaoyuan@gmail.com> +Date: Sun, 23 Jan 2022 10:09:17 -0800 +Subject: [PATCH] Replace Pointer.SIZE with Native.POINTER_SIZE for JNA 5.x + +This patch is backward compatible with JNA 4.x because +Native.POINTER_SIZE is present in both 4.x and 5.x. + +Bug: https://github.com/kaitoy/pcap4j/issues/191 +Bug: https://bugs.gentoo.org/830847 +Signed-off-by: Yuan Liao <liaoyuan@gmail.com> +--- + src/freenet/io/comm/UdpSocketHandler.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/freenet/io/comm/UdpSocketHandler.java b/src/freenet/io/comm/UdpSocketHandler.java +index 0cd975f16..c004613a9 100644 +--- a/src/freenet/io/comm/UdpSocketHandler.java ++++ b/src/freenet/io/comm/UdpSocketHandler.java +@@ -120,7 +120,7 @@ public class UdpSocketHandler implements PrioRunnable, PacketSocketHandler, Port + return false; + int ret = -1; + try { +- ret = socketOptionsHolder.setsockopt(fd, SOCKET_level.IPPROTO_IPV6.linux, p.option_name.linux, new IntByReference(p.linux).getPointer(), Pointer.SIZE); ++ ret = socketOptionsHolder.setsockopt(fd, SOCKET_level.IPPROTO_IPV6.linux, p.option_name.linux, new IntByReference(p.linux).getPointer(), Native.POINTER_SIZE); + } catch(Exception e) { Logger.normal(UdpSocketHandler.class, e.getMessage(),e); } //if it fails that's fine + return (ret == 0 ? true : false); + } +-- +2.34.1 + |