Repository navigation
VMNetworkInterface: require both IFF_UP and IFF_RUNNING in isUp() - #78
Open
guillerodriguez wants to merge 1 commit into
Open
guillerodriguez wants to merge 1 commit into
guillerodriguez wants to merge 1 commit into
Conversation
NetworkInterface.isUp() should return true when the interface is "up and running", so IFF_UP and IFF_RUNNING must both be set. The current implementation returns true when either flag is set. Fix it by requiring both flags, also matching what OpenJDK does. On Haiku, where there is no IFF_RUNNING, use IFF_LINK instead. Commit c74aac5 avoided this because IFF_LINK can be set even when the interface is down. Now that both flags are required, IFF_UP combined with IFF_LINK means "up and running" as intended. Fail compilation on other platforms that lack IFF_RUNNING. Fixes #77 (BZ#42817) Signed-off-by: Guillermo Rodríguez <grodriguez@ingelabs.com>
Contributor
Author
|
@duncanmcqueen if you could re-run the checks from #75 (comment) on Haiku, that would be great. This should fix the "interface up, cable disconnected" case:
|
phvega
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NetworkInterface.isUp() should return true when the interface is "up and running", so IFF_UP and IFF_RUNNING must both be set. The current implementation returns true when either flag is set. Fix it by requiring both flags, also matching what OpenJDK does.
On Haiku, where there is no IFF_RUNNING, use IFF_LINK instead. Commit c74aac5 avoided this because IFF_LINK can be set even when the interface is down. Now that both flags are required, IFF_UP combined with IFF_LINK means "up and running" as intended.
Fail compilation on other platforms that lack IFF_RUNNING.
Fixes #77 (BZ#42817)