From fcb84fa13d6ec8febe1e102b35665b93a29f9a12 Mon Sep 17 00:00:00 2001 From: duncanmcqueen Date: Wed, 14 Oct 2026 15:07:10 -0500 Subject: [PATCH] VMNetworkInterface: define IFF_RUNNING if the system does not Haiku does not define IFF_RUNNING, so java_net_VMNetworkInterface.c does not compile. Define it as 0 when the system does not define it, so that isUp() tests IFF_UP only. Haiku's IFF_LINK is not a replacement: it tells if the hardware has a link, also when the interface is down. Co-Authored-By: Claude Opus 5.5 Signed-off-by: duncanmcqueen --- native/jni/java-net/java_net_VMNetworkInterface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/native/jni/java-net/java_net_VMNetworkInterface.c b/native/jni/java-net/java_net_VMNetworkInterface.c index 658299733e..1e254942cb 100644 --- a/native/jni/java-net/java_net_VMNetworkInterface.c +++ b/native/jni/java-net/java_net_VMNetworkInterface.c @@ -67,6 +67,13 @@ exception statement from your version. */ #include "java_net_VMNetworkInterface.h" +/* Some systems, for example Haiku, do not define IFF_RUNNING. Then + isUp() tests IFF_UP only. (Haiku's IFF_LINK is not the same: it + tells if the hardware has a link, also when the interface is down.) */ +#ifndef IFF_RUNNING +# define IFF_RUNNING 0 +#endif + int iff_flags(JNIEnv *, jstring, jint *); static jmethodID java_net_VMNetworkInterface_init;