Repository navigation
VMNetworkInterface: define IFF_RUNNING if the system does not - #75
Conversation
a30248d to
b269409
Compare
b269409 to
aa19015
Compare
|
I am not sure defining
But on Haiku, if I am not wrong (I haven't tested this), I think a safe alternative here for Haiku would be to test A better long-term fix would be to change the implementation to require "both flags set" instead of "either flag set" on all platforms. Then we could check both Either way it would be useful if you could test the following three cases on Haiku, and paste the output of
Thanks! |
aa19015 to
6544274
Compare
|
Thank you. You are correct. I did the three tests on Haiku (hrev60228 x86_64, QEMU e1000). For case 2, I used the QEMU monitor command 1. Interface down, cable connected
2. Interface up, cable disconnected (The "Media type" line is also not shown.) 3. Loopback I agree with your short-term fix. I changed the commit: when the system does not define
The socket test passed in all cases. For case 2, "both flags set" with |
|
Perfect, thank you! |
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 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <dwmcqueen@gmail.com>
6544274 to
fcb84fa
Compare
|
@duncanmcqueen see #78 |
Split from #60.
Problem and fix
Haiku does not define
IFF_RUNNINGin<net/if.h>. Thusjava_net_VMNetworkInterface.cdoes not compile, and the build ofmasterstops on Haiku.Now the file defines
IFF_RUNNINGas 0 when the system does not define it. ThenNetworkInterface.isUp()testsIFF_UPonly.Haiku's
IFF_LINKis not a replacement forIFF_RUNNING: it tells if the hardware has a link, also when the interface is down (see the tests in the comments).Note: #60 defined
IFF_RUNNINGas 0x40. On Haiku, 0x40 isIFF_NOARP, so that value was not correct.How to reproduce
On Haiku, configure and build
master:To test the result, run this program (it also needs #73 and #74 to build and load on Haiku):
NetBasics.javaResults
Haiku R1/beta6 x86_64 (hrev59866),
javacfrom OpenJDK 8, Kaffe 1.1.10-pre. I ranautoreconfon Linux (autoconf 2.73, automake 1.19) and built on Haiku out of tree with--enable-jni --disable-examples --disable-plugin --disable-gjdoc --disable-gtk-peer --disable-gconf-peer --disable-alsa --disable-dssi.Platforms
Specific to systems that do not define
IFF_RUNNING. Haiku is the system that I know. Linux, macOS and the BSDs defineIFF_RUNNING, so the new lines have no effect there.AI assistance
An AI model (Claude Code, by Anthropic) wrote this change, the test and this text. The repository owner directed the work and checked the results. Please review it as you review other contributions.
🤖 Generated with Claude Code