1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
|